Skip to content
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

v8.0.0-beta.11 Cannot be used in deno deploy #1993

Closed
so1ve opened this issue Apr 14, 2023 · 7 comments
Closed

v8.0.0-beta.11 Cannot be used in deno deploy #1993

so1ve opened this issue Apr 14, 2023 · 7 comments
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf v8

Comments

@so1ve
Copy link
Contributor

so1ve commented Apr 14, 2023

Environment

- Operating System: Windows_NT
- Node Version:     v18.15.0
- Nuxt Version:     3.4.1
- Nitro Version:    2.3.3
- Package Manager:  [email protected]
- Builder:          vite
- User Config:      srcDir, build, vite, modules, css, colorMode, googleFonts, i18n, nitro, experimental, typescript
- Runtime Modules:  @vueuse/[email protected], @pinia/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], unplugin-icons/nuxt
- Build Modules:    -

Note: This is my project configuration. The configuration causes this problem is installing @nuxtjs/i18n.

Reproduction

https://github.com/so1ve/nuxt-process-versions-node-undefined-repro

Just create a fresh nuxt app with latest nuxt-i18n. Set NITRO_PRESET environment to deno. Build this project, cd .output and run deno run server/index.ts.
Stackblitz reproduction is not available because we need to use deno.

Describe the bug

error: Uncaught TypeError: Cannot read properties of undefined (reading 'split')
const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10))

It seems that some dependency of nuxt-i18n is using readdirp (I can check later), which includes the following code:

const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10));

process.versions.node is not shimed. So it became undefined.

Additional context

Maybe this is an unenv issue?

Logs

No response

@so1ve so1ve changed the title v8.0.0-beta.11 Cannot use in deno deploy v8.0.0-beta.11 Cannot be used in deno deploy Apr 14, 2023
@kazupon kazupon added v8 help wanted good first issue 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage PR Welcome and removed pending triage labels Apr 14, 2023 — with Volta.net
@so1ve
Copy link
Contributor Author

so1ve commented Apr 15, 2023

Wait - why is readdirp bundled into dist files? It is a chokidar dependency, and chokidar is a devDependency in nuxt.

@zsilbi
Copy link

zsilbi commented Apr 21, 2023

This also breaks serverless deployments currently where process.versions.node is undefined as well.

@so1ve
Copy link
Contributor Author

so1ve commented Apr 21, 2023

@so1ve
Copy link
Contributor Author

so1ve commented Apr 21, 2023

This change is introduced in #1938

@n-kort
Copy link

n-kort commented Jun 23, 2023

netlify-edge functions also fail to build nuxt/nuxt#21719

@kazupon kazupon added ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf help wanted and removed 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage PR Welcome help wanted good first issue labels Jun 24, 2023 — with Volta.net
Copy link
Collaborator

kazupon commented Jul 17, 2023

This issue was fixed since @intlify/bundle-utils is no longer bundled on the server side as of v8.0.0-beta.13.
If you have still issue, please reply.

@so1ve
Copy link
Contributor Author

so1ve commented Jul 17, 2023

Thanks!

@so1ve so1ve closed this as completed Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf v8
Projects
None yet
Development

No branches or pull requests

4 participants