-
-
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
.proxyrc.js refuses to work with ES6 ("type" = "module") node projects. #7330
Comments
The relevant code: Search paths for the proxy config parcel/packages/reporters/dev-server/src/Server.js Lines 368 to 373 in 3eb0fc7
Location where the config is then parcel/packages/core/utils/src/config.js Lines 72 to 76 in 3eb0fc7
|
Any update on when this might be fixed? |
Yea we need a fix when you can |
please add support for |
I temporary hacked around this problem by wrapping my parcel commands in a script that dynamically writes a |
🐛 bug report
When trying to run parcel in a
"type": "module"
node package, the .proxyrc.js refuses to function, getting treated as common js to a degree. Renaming to.proxyrc.cjs
or.proxyrc.mjs
appears to be unsupported and are never picked up. This basically makes it impossible to leverage another es6 module in the.proxyrc.js
. Attempting to utilize theimport(...)
function available in modern node causes issues. I attempted to simply change the extension in theServer
parcel class to use cjs or mjs but both resulted in some JSON parsing error.{
"type": "module"
}
none
🤔 Expected Behavior
Support .proxyrc.js in type=module node projects, or alternatively support loading mjs/cjs .proxyrc files.
😯 Current Behavior
Errors on startup when the configuration attempts to load.
When trying to use type module:
💁 Possible Solution
Couldn't find a workaround unfortunately, tried all sorts of combinations.
🔦 Context
Trying to use parcel in a module (ES6)-based project.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: