-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
TypeError: Cannot read property 'split' of undefined #65
Comments
You just need to escape the ending $ sign:
Otherwise dotenv-expand attempts to interpolate it. You raise a good issue though that ideally it should be smart enough to recognize a dollar sign followed by some text as a variable, and dollar signs on their own could exist on their own without being escaped. This would need to be modified in the regex. I'll look into that, but for now you can just modify your .env file. |
👋 Just wanted to +1 this as we've also just run into this after updating Next.js, which bumped from 5.x to 8.x for this lib and introduced this bug. |
I'm using serverless-dotenv-plugin and few of my env vars have "$". I solved escaping all Ex: KEY=VAL\\$UE |
Had to change some of my passwords that had |
In version Example: |
in
if you need to include the |
A simple
.env
file containing:SERVER_HOST=localhost:8080
CORS_ALLOWED_ORIGINS=/${SERVER_HOST}(:[0-9]+)?$/
will throw this error when configured:
TypeError: Cannot read property 'split' of undefined
This issue wasn't happening in version
5.1.0
but I noticed it in8.0.1
The text was updated successfully, but these errors were encountered: