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
Module breaks Nuxt 3 build for Cloudflare Pages (Cannot read properties of undefined (reading 'split')) #2031
Comments
I have encountered a similar issue. |
To be clear, it's a runtime exception, not a build-time exception. Cloudflare Pages uses a standard node/npm environment for building. |
Seems |
I encountered the same issue too. |
I created an i18n plugin by myself, surprisingly it works well |
Still an issue in beta 12 |
@guoyk93 Could you share your code? |
https://gist.github.com/guoyk93/b09d964fcb72a6905df25fe86474c0f6 It's a very primitive implementation, but works well enough for me. |
Hey, I got the same issue, but for Cloudflare Workers. Hope this'll patched in new version! |
I did some investigations: this issue is introduced in #1938. It upgraded @intlify/bundle-utils and seemed to be the cause of this issue |
FYI to fix this issue temporarily: use a custom rollup plugin to replace |
Can you share how you setup the rollup plugin? |
@ploca14 You can refer to so1ve/dolan-client-meme@64f815f Update: This commit fixed this issue but comes with another issue 😅 I have to downgrade this module again It seemed that i18n module bundles some unused dependencies which will break the code |
Bump this issue |
This issue was fixed since |
Indeed, the issue has been fixed. Thank you for the notice |
Environment
Reproduction
Repo: https://github.com/AlexDicy/nuxt-18n-cf-pages-reproduction
https://stackblitz.com/github/AlexDicy/nuxt-18n-cf-pages-reproduction?file=README.md
Describe the bug
As soon as the module is added to the project the build target Cloudflare Pages stops working because a dependency (readdirp) is executed in the build, causing the preview/deployment to fail.
readdirp tries to access
process.versions.node.split
which doesn't exist in a Cloudflare Worker enviroinmentAdditional context
The bug has been introduced in beta-11
Logs
The text was updated successfully, but these errors were encountered: