-
-
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
Build error with version 2.3.1: @parcel/core: Failed to resolve 'process' from ... #7697
Comments
Having the same issue.
It started with 2.3.0. .parcelrc
(Same behaviour with empty .parcelrc) |
Have the same problem with Temporary workaround is to add alias to
|
I was having this issue related to This solved it, in builds and dev. Basically, define process for the browser as an empty object:
|
I tried the following code: import axios from 'axios';
console.log(axios) and the console output was:
So, it auto installed |
@devongovett for me it is reproducible quite easily. The simplest example would be 2 file project: index.html:
package.json:
that results in the error noted by others above:
Tried on both Node 14 and Node 16 with the same outcome. I also tried enabling more logging by |
just linking my issue repro here as well: #7060 (comment) also a problem with glad to help contribute to this fix as well |
@koskokos2 if you run Parcel and pipe the output to cat you can see the full output.
|
Oh, thanks. Looks like it tried to auto-install
|
another weird thing i noticed using the build works when explicitly providing a source this works
...
"scripts": {
"serve": "parcel src/index.html",
"build": "parcel build src/index.html"
},
... but it doesn't work when you state a this does not work
...
"source": "src/index.html",
"scripts": {
"serve": "parcel src/index.html",
"build": "parcel build"
},
... |
For me, I've added the following to my package.json : Now I can build on docker and it's working fine on nginx (ya!) but on local it does not work anymore... (Process is undefined) I think I'm gonna downgrade to parcel 2.2 for now until it's resolved... |
Here I've the same problem with |
Same issue, also with Axios. Update: I can see it briefly that it detects there is |
Adding |
Having this error as well from migration from v1 to v2, even downgrading to 2.2 did not work, polyfill does not seem to be installing like the logs say.
Alias Reference: https://parceljs.org/features/node-emulation/ |
I'm upgrading from 2.2.1 to 2.3.1, this time I'm getting same issue with NodeJS built-ins, for me it is Buffer.
|
For folks seeing issues with |
I was having this issue related to |
I get a similar error when trying to build Apollo Client, where Similarly to @tpudel I
|
I'm hitting this when using aws-amplify:
I tried to reduce it, but can't make it happen in isolation. |
Ran into a similar sounding error using 2.3.1:
I had to go to the Node Emulation: Polyfilling & Excluding Builtin Node Modules Similar to what tpudel described: #7697 (comment) but I did not need to create the alias for buffer, just install the npm package. node v14.17.1 npm 7.24.2 parcel 2.3.1 |
I'm having the same issue with firebase firestore
Tried the mentioned solutions but nothing worked for me, here's what I did:
Here's my package.json file snippet:
|
for some reason modifying alias to the following worked in dev and build
|
Just changing process to the above as @MuhammadM1998 has without installing |
This issue is still present. The alias workaround worked to unblock me. |
Any updates on this? Having the same issue. |
Still have this error in parcel 2.7.0, with pnpm. Can you fix it? |
I've the similar problem. But i use my own |
Any updates on this? Having the same issue. |
still having thi issue on node 14, parce 2.8 with pnpm, no issue with npm |
Bump, this is still an issue on 2.8.0 |
Having is issue with parcel 2.8.2 and the axios library. Anyone know a fix? |
The fixes are conflicting now... Sentry+Utils can be fixed with:
and axios can be fixed with
but how do I fix both? |
@wesbos Can you share an example with the sentry and axios versions you're using? And what exactly are you importing from them? |
@mischnic Here is a very small reproduction: |
Thanks to @mischnic - found the issue. Apparently pnpm autoinstall is broken. Add these dev deps to your package.json. Note I was using parcel in a workspace, but these need to be installed in the project root. "buffer": "^5.5.0",
"process": "^0.11.10", Then add these alias to package.json: "alias": {
"process": "process/browser.js",
"buffer": "buffer"
}, Then install and run parcel, and you are back working! also see node emulation |
10:35:32 PM: @parcel/core: Failed to resolve 'process' from 10:35:32 PM: './node_modules/@sentry/utils/esm/node.js'` issue from parcel-bundler/parcel#7697 (comment)
The "alias" solution doesn't work for me :( my issue is with "process" on a library I'm requiring. |
I’ve just ran into this with NPM on a tiny project with no dependencies other than Parcel. I imagine my issue might be from not properly closing the port, as my terminal window was hanging so I force-quit it. Reloading my terminal didn’t fix the problem nor did a system restart. I use PNPM for other projects, so that may be the culprit? Wes’ workaround at #7697 (comment) solved the issue (server successfully started). |
I just ran into this issue on v2.11.0 in a GitHub action, but not when building locally. From the looks of things, it appears this was marked as fixed in v2.3.2, but yeah, just started getting the same issue in v2.11.0 after installing a new package (that presumably uses Edit: to note, the workaround at #7697 (comment) does indeed work for me as well. |
🐛 bug report
I just upgraded to version 2.3.1 and now the build process fails.
Don't know exactly if this is a parcel or a sentry issue?
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Build should pass.
😯 Current Behavior
The build fails with the following exception:
💁 Possible Solution
idk.
🔦 Context
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: