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.local crash due to dollar symbol #37207

Closed
1 task done
AverTry opened this issue May 26, 2022 · 2 comments
Closed
1 task done

.env.local crash due to dollar symbol #37207

AverTry opened this issue May 26, 2022 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@AverTry
Copy link

AverTry commented May 26, 2022

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

win11

What browser are you using? (if relevant)

Chrome Engine Brave

How are you deploying your application? (if relevant)

No response

Describe the Bug

running the dev script on a new create-next-app
using .env.local

NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk$

Add a Dollar $ symbol anywhere in the value causes

error - Failed to load env from C:\Users\admin\Documents\myapp\.env.local TypeError: Cannot read properties of undefined (reading 'split')
    at C:\Users\admin\Documents\myapp\node_modules\@next\env\dist\index.js:1:311
    at Array.reduce (<anonymous>)
    at _interpolate (C:\Users\admin\Documents\myapp\node_modules\@next\env\dist\index.js:1:125)
    at expand (C:\Users\admin\Documents\myapp\node_modules\@next\env\dist\index.js:1:709)
    at processEnv (C:\Users\admin\Documents\myapp\node_modules\@next\env\dist\index.js:1:3638)
    at Module.loadEnvConfig (C:\Users\admin\Documents\myapp\node_modules\@next\env\dist\index.js:1:4443)
    at Object.loadConfig [as default] (C:\Users\admin\Documents\myapp\node_modules\next\dist\server\config.js:40:21)
    at NextServer.loadConfig (C:\Users\admin\Documents\myapp\node_modules\next\dist\server\next.js:114:48)
    at NextServer.getServer (C:\Users\admin\Documents\myapp\node_modules\next\dist\server\next.js:120:39)
    at NextServer.prepare (C:\Users\admin\Documents\myapp\node_modules\next\dist\server\next.js:96:35)

Expected Behavior

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from C:\Users\admin\Documents\env-test\.env.local
wait  - compiling...
event - compiled client and server successfully in 4.7s (170 modules)

To Reproduce

running the dev script on a new create-next-app
using .env.local

NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk$

Add a Dollar $ symbol anywhere in the value causes

@AverTry AverTry added the bug Issue was opened via the bug report template. label May 26, 2022
@balazsorban44
Copy link
Member

Duplicate of #36691

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants