-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
MemberExpressions attempts to convert process.env.hasOwnProperty to a node #1440
Comments
Had the same error in this project. |
@Ronnie1734 does yours still repro / have you found a fix? |
Anyone? |
@EricRabil Hello. Just tried to use parcel and it can't load dotenv. To repro you need just two lines of code: import dotenv from 'dotenv'
dotenv.config() |
Getting the same error when trying to use |
Having same issue, have you been lucky solving it pls? EDIT: Not a fix, but quick workaround is to use dotenv v4.0.0 - works well |
Same here, impossible to use dotenv with parcel. Any update on that subject? |
This fixes #1440. Package "dotenv" does something like "process.env.hasOwnProperty( ... )". Parcel expects a value property lookup on process.env, not a function call. So valueToNode fails if it was called with a function like "hasOwnProperty".
This fixes #1440. Package "dotenv" does something like "process.env.hasOwnProperty( ... )". Parcel expects a value property lookup on process.env, not a function call. So valueToNode fails if it was called with a function like "hasOwnProperty".
This fixes #1440. Package "dotenv" does something like "process.env.hasOwnProperty( ... )". Parcel expects a value property lookup on process.env, not a function call. So valueToNode fails if it was called with a function like "hasOwnProperty".
🐛 bug report
At
/src/visitors/globals.js:26
, Parcel is recognizing DotEnv's call toprocess.env.hasOwnProperty(...)
and is attempting to convert it to a node, causing the babel converter to throw an exception.🎛 Configuration (.babelrc, package.json, cli command)
.babelrc
package.json
cli
🤔 Expected Behavior
It should be able to compile
😯 Current Behavior
It throws the above error due to DotEnv
💁 Possible Solution
In
/src/visitors/globals.js
at the MemberExpressions definition, check whether the inline access toprocess.env
is a function call, and if so, do not attempt to coerce it to a node.🔦 Context
The issue affects me by preventing the build process from completing.
I am spawning a parcel instance through child_process however the error occurs when running it from a standard CLI. I am compiling a TypeScript/Vue project and redirecting it to another directory.
💻 Code Sample
https://github.com/EricRabil/StormStarter
🌍 Your Environment
The text was updated successfully, but these errors were encountered: