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

Issues with std-env and NODE_ENV #21313

Closed
1 of 3 tasks
pi0 opened this issue Jun 2, 2023 · 0 comments · Fixed by #21372
Closed
1 of 3 tasks

Issues with std-env and NODE_ENV #21313

pi0 opened this issue Jun 2, 2023 · 0 comments · Fixed by #21372

Comments

@pi0
Copy link
Member

pi0 commented Jun 2, 2023

Environment

  • Operating System: Darwin
  • Node Version: v18.16.0
  • Nuxt Version: 3.5.2
  • Nitro Version: 2.4.1
  • Package Manager: npm@9.5.1
  • Builder: vite
  • User Config: build, experimental
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Describe the bug

When using isDevelopment and isProduction exports of std-env do not work since nuxt provides NODE_ENV using an static code replacement

  • std-env should use static analyzable syntax (Support static NODE_ENV detection unjs/std-env#45)
  • std-env should be transpiled by default to make sure Nuxt and Nitro can replace it inline (workaround in reproduction but commented out)
  • (vite) Client build seems not providing it to the libs when when adding std-env to transpile

Additional context

This is a followup from unjs/std-env#45. We might as well consider this as not supported.

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants