next-on-pages question on next/dynamic
The project in question is private, so I can't share the link, but I'm curious whether there's any resources on troubleshooting a Next.js dynamic module. My module is functioning normally when run through
next dev
, but fails with the error ReferenceError: async__chunk_8335 is not defined
when run on either the preview command or when deployed to Cloudflare Pages.4 Replies
I managed to put together a minimal reproduction at https://github.com/nicholasfulton/next-on-pages-bug
GitHub
GitHub - nicholasfulton/next-on-pages-bug: Demo to show how next/dy...
Demo to show how next/dynamic fails to load on edge runtime. - nicholasfulton/next-on-pages-bug
It seems (from a SDK user's perspective) that the issue comes from next/dynamic chunks somehow not being included in next-on-pages' build process when using the edge runtime.
I created an issue on GitHub (since this appears to be a bug) at https://github.com/cloudflare/next-on-pages/issues/941
GitHub
[🐛 Bug]: ReferenceError when using next/dynamic · Issue #941 · clou...
next-on-pages environment related information System: Platform: linux Arch: x64 Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H Memory: 15 GB Shell: /...
Unfortunately we probably won't get around to looking into this - i would recommend trying out the OpenNext adapter with your project if possible instead