-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Beta] Astro MDX renderer is not bundled #12029
Comments
I can't reproduce the issue with the link given. I'm seeing that it's properly bundled. Perhaps you could double check that all Astro dependencies are upgraded? |
I've figured out the issue. I'm using Astro Container API. To make it work on Cloudflare, I previously needed to mark container modules as external and this does not work for Astro v5 beta. vite: {
ssr: {
// previously v4
// external: ["astro/container", "@astrojs/mdx"],
external: [
'astro/container',
'node:fs',
'node:fs/promises',
'fs',
'node:url',
'node:path',
'path',
],
},
}, Here's the updated reproduction https://stackblitz.com/edit/github-jkjbbg-nhzsfm Perhaps it's an issue with Astro Container API? Think it should work out of the box with CF integration. |
In order to fix the issue, you need to load the render manually, otherwise it isn't bundled. The way you're loading the renderer is meant for cases like
Here's how you load the MDX renderers: import mdxRenderer from "@astrojs/mdx/server.js";
const astroContainer = await AstroContainer.create();
astroContainer.addServerRenderer({renderer: mdxRenderer}); |
Not sure I understand correctly. The reason I'm loading it as such is because of Node.js built-in imports causing Vite to throw error when building for Cloudflare workers (via |
I did test it using your reproduction, and it built successfully. |
Yes, it built successfully because I added all Node.js built-ins to What I'm saying is Astro Container API should work with CF integration without having to configure Issue is somewhat similar to this #6537 |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Deployment to CF Pages failed due to non-existent '@astrojs/mdx/server.js'.
Here's the output of
dist\_worker.js\chunks\_@astro-renderers_[hash].mjs
.What's the expected result?
MDX renderer should be bundled.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-jkjbbg
Participation
The text was updated successfully, but these errors were encountered: