rasendubi / uniorg

An accurate Org-mode parser for JavaScript/TypeScript
https://oleksii.shmalko.com/uniorg
GNU General Public License v3.0
256 stars 24 forks source link

astro-uniorg not compatible with Astro v3 #88

Closed ispringle closed 12 months ago

ispringle commented 1 year ago

Looks like Astro v3 and astro-uniorg are not compatible. After upgrading to Astro v3 (yarn add astro) it begins to give this error:

10:36:48 AM [astro] reload /src/pages/[...slug].astro
 error   Unable to render `Content`.

  No valid renderer was found for this file extension.
  Hint:
    Did you mean to enable the `@astrojs/react`, `@astrojs/preact`, `@astrojs/solid-js`, `@astrojs/vue`, `@astrojs/svelte` or `@astrojs/lit` integration?

    See  https://docs.astro.build/en/core-concepts/framework-components/  for more information on how to install and configure integrations.
  Error reference:
    https://docs.astro.build/en/reference/errors/no-matching-renderer/
  File:
    /Users/IPringle/git/hub/ispringle/sylvan/src/pages/[...slug].astro
  Stacktrace:
NoMatchingRenderer: Unable to render `Content`.

No valid renderer was found for this file extension.
    at renderFrameworkComponent (/Users/IPringle/git/hub/ispringle/sylvan/node_modules/astro/dist/runtime/server/render/component.js:155:15)
    at async Module.renderComponent (/Users/IPringle/git/hub/ispringle/sylvan/node_modules/astro/dist/runtime/server/render/component.js:344:10)

I'm wondering if this is because the astro-uniorg integration/plugin does not provide addRenderer in the hook. On a whim I also tried doing what Astro suggested and installed React, but that just gave some new React errors, likely because React can't consume org files. I wasn't certain what uniorg entry point to use for the addRenderer callback, though I'm uncertain if that'd have fixed this problem anyway. I also asked on the Astro discord and spoke with an Astro dev briefly and he suggested that there should not be any issues with any integrations and if it worked in v2 it should work in v3, so this might be a problem on Astro's side.

ispringle commented 1 year ago

I opened an issue with Astro to see if this was a problem on their end. Sounds like the issue is that Astro v3 is a bit more strict in how integrations work and won't allow you to directly interact with Vite and not register the renderer with. https://github.com/withastro/astro/issues/8421

rasendubi commented 1 year ago

Yeah. I haven't upgraded to astro v3 yet and I think some migration is needed

astro-uniorg is heavily inspired by astro-mdx, so maybe we can take a look at the latest changes there

rasendubi commented 12 months ago

89 adds support for Astro v3

rasendubi commented 12 months ago

The fix should be released as astro-org-2.0.0 in a second.

ispringle commented 12 months ago

Thanks! Works like a charm.