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

Add env wildcards for framework Nitro NITRO_* #8504

Open
1 task done
MickL opened this issue Jun 15, 2024 · 6 comments
Open
1 task done

Add env wildcards for framework Nitro NITRO_* #8504

MickL opened this issue Jun 15, 2024 · 6 comments
Labels
kind: bug Something isn't working owned-by: turborepo

Comments

@MickL
Copy link

MickL commented Jun 15, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.4-canary.4

Describe the Bug

Nitro is the server framework that Nuxt is using. It is part of every Nuxt application but is also an awesome API framework on its own that deploys everywhere (e.g. on Vercel Functions and Vercel Edge Functions).

When using Nitro separate all env variables start with NITRO_*. This wildcard should be added to the Framework Inference.

This will also fix deployments of Nuxt that deploy to any given preset that is not node-server (e.g. vercel), see #8503

Expected Behavior

To Reproduce

Additional context

No response

@MickL MickL added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Jun 15, 2024
@anthonyshew
Copy link
Contributor

Works for me! Code is here for you, future me, or anyone else that wants to make this PR:

fn get_frameworks() -> &'static [Framework] {

@MickL
Copy link
Author

MickL commented Jun 15, 2024

I will do a PR, also to update the docs.

btw I wonder why is says NUXT_ENV_*, it should be NUXT_*

@anthonyshew
Copy link
Contributor

Is it meant to be NUXT_*? I think I'm the only one on the team who has ever used Nuxt and it was a hello-world. 😄 If you want to add that to the PR and provide the documentation that shows that it's supposed to be NUXT_*, that would be great!

@MickL
Copy link
Author

MickL commented Jun 15, 2024

It is NUXT_* for server variables and NUXT_PUBLIC_* for frontend variables. Docs: https://nuxt.com/docs/guide/going-further/runtime-config#environment-variables

Until now nobody noticed but with v2 all env variables are removed so it will start to break. Also I wonder if Nuxt/Nitro detects some providers by environment variables. If yes than this environments are not zero config anymore when using Turbo.

P.S. Nuxt is great but I guess you guys are more into supporting Next.js and Vercel 😄

@anthonyshew
Copy link
Contributor

Happy to support popular frameworks! Just a simple mistake on our part. We don't claim to be perfect.

@anthonyshew anthonyshew removed the needs: triage New issues get this label. Remove it after triage label Jun 15, 2024
@anthonyshew
Copy link
Contributor

anthonyshew commented Jun 27, 2024

@NamesMT got us a fix in for NUXT_*: #8616

Does this fix the Nitro case as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working owned-by: turborepo
Projects
None yet
Development

No branches or pull requests

2 participants