Open hamlim opened 4 months ago
Seems like 15.0.0-canary.38
(and later canaries) is where the above error starts to show up, from 15.0.0-canary.0
- 15.0.0-canary.37
the error I get is the below error:
Package next-mdx-remote (serverExternalPackages or default list) can't be external
The request next-mdx-remote/rsc matches serverExternalPackages (or the default list), but it can't be external:
The package seems invalid. require() resolves to a EcmaScript module, which would result in an error in Node.js.
My hunch is that this code within that package is the problematic part: https://github.com/hashicorp/next-mdx-remote/blob/17d6598d4cbb9ccf0fe1042253649d88d685fa5f/src/jsx-runtime.cjs#L11-L15
Same issue
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
Adding some more context to this in case it helps:
I encountered the same when trying to deploy my site on Netlify. It was a fresh repo cloned from Next's Portfolio Blog example, and it was building fine locally with NodeJS 20.17
and Next 14.2.0-canary.62
. But Netlify seems to be using the 15-canary
so it failed there.
I finally downgraded to Next 14, and it deployed without a hitch.
Link to the code that reproduces this issue
https://github.com/hamlim/next-mdx-remote-jsx-runtime-bug
To Reproduce
bun install
cd apps/docs
bun run dev
Current vs. Expected behavior
I see the following error:
Ideally - I wouldn't get any error!
Provide environment information
Which area(s) are affected? (Select all that apply)
Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
I've tested this in several Next 15 canaries, haven't been able to bisect releases to find out when this might have changed just yet.
I've also cross reported to the
next-mdx-remote
project here: https://github.com/hashicorp/next-mdx-remote/issues/467