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

Env variables with special characters #14985

Closed
Deepak13245 opened this issue Jul 8, 2020 · 3 comments
Closed

Env variables with special characters #14985

Deepak13245 opened this issue Jul 8, 2020 · 3 comments

Comments

@Deepak13245
Copy link

Bug report

Describe the bug

Env variables having special characters are not being loaded from .env.local

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. In .env.local add a variable with special characters. NEXT_PUBLIC_TEST="abcd$ef"
  2. In next.config.js add a log. console.log(process.env.NEXT_PUBLIC_TEST)
  3. The log will print only abcd

Expected behavior

It should load complete value abcd$ef

System information

  • OS: macOS
  • Version of Next.js: 9.4.4
  • Version of Node.js: 12.9.1
@Tudes
Copy link

Tudes commented Jul 8, 2020

Hi, @Deepak13245 I'm not sure if the issue is with NextJS per se.

With dotenv previously you'd have to escape the $ sign in environment variables. You'll have to do the same here e.g. abcd\$ef

@Deepak13245
Copy link
Author

Got it ! Thanks @Tudes

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants