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

Load multiple env files #856

Open
QuangHD-GearInc opened this issue Oct 13, 2023 · 2 comments
Open

Load multiple env files #856

QuangHD-GearInc opened this issue Oct 13, 2023 · 2 comments

Comments

@QuangHD-GearInc
Copy link

QuangHD-GearInc commented Oct 13, 2023

What is the problem?

I saw in the document, we can pass all the environments as comma-separated strings. For example:

blitz dev --env staging,production

But It didn't work with my nextjs 13 project. I only can run with 1 environment.
How can I run with multiple env files?

Run blitz -v and paste the output here:

Blitz version: 2.0.0-beta.33 (global)
Blitz version: 1.0.0 (local)
macOS Ventura | darwin-arm64 | Node: v18.15.0


 Package manager: npm

  System:
    OS: macOS 13.5
    CPU: (8) arm64 Apple M1
    Memory: 111.50 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
    npm: 9.6.3 - ~/.nvm/versions/node/v18.15.0/bin/npm
  npmPackages:
    @blitzjs/auth: Not Found
    @blitzjs/next: Not Found
    @blitzjs/rpc: Not Found
    @prisma/client: Not Found
    blitz: Not Found
    next: 13.4.2 => 13.4.2 
    prisma: Not Found
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    typescript: 5.0.4 => 5.0.4 
@siddhsuresh
Copy link
Member

siddhsuresh commented Oct 15, 2023

@QuangHD-GearInc Thanks for the issue!

we can currently set the APP_ENV to a singular environment which will in-turn load the env files of the following pattern

`.env.${APP_ENV}.local`,
`.env.${APP_ENV}`,
`.env.local` //if `APP_ENV` is not a test 
`.env`,

can you paste the link to docs mentioning that we can pass environments as comma-separated strings, so that it can be fixed?

@horizon0514
Copy link

@QuangHD-GearInc Thanks for the issue!

we can currently set the APP_ENV to a singular environment which will in-turn load the env files of the following pattern

`.env.${APP_ENV}.local`,
`.env.${APP_ENV}`,
`.env.local` //if `APP_ENV` is not a test 
`.env`,

can you paste the link to docs mentioning that we can pass environments as comma-separated strings, so that it can be fixed?

here is the doc link https://blitzjs.com/docs/custom-environments#custom-environments

@siddhsuresh siddhsuresh transferred this issue from blitz-js/blitz Feb 6, 2024
@blitzjs-bot blitzjs-bot added this to Triage in HQ Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
HQ
Triage
Development

No branches or pull requests

4 participants