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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node globals are not resolved in the dependencies #8433

Closed
aminya opened this issue Sep 1, 2022 · 8 comments
Closed

Node globals are not resolved in the dependencies #8433

aminya opened this issue Sep 1, 2022 · 8 comments

Comments

@aminya
Copy link
Contributor

aminya commented Sep 1, 2022

馃悰 bug report

The node globals like process are not resolved in the dependencies when targeting the browser.

馃毃 Build failed.
@parcel/core: Failed to resolve 'process' from './node_modules/.pnpm/admina@0.1.3/node_modules/admina/src/root.ts'

  D:\a\patha\patha\node_modules\.pnpm\admina@0.1.3\node_modules\admina\src\root.ts:25:10

    24 |   // TODO not all CI systems are root

  > 25 |   return process.getuid?.() === 0 || Boolean(process.env.CI)
馃挕 Did you mean '_../node_modules/.bin_'?
  >    |          ^^^^^^^
馃挕 Did you mean '_../node_modules_'?
    26 | }

    27 | 

馃帥 Configuration (.babelrc, package.json, cli command)

https://github.com/aminya/patha/blob/f110c46226ad8b84bd466735e96afa4dfee44616/package.json#L19-L74

馃 Expected Behavior

the process should be handled as stated in the docs
https://parceljs.org/features/node-emulation/#shimming-builtin-node-globals

馃槸 Current Behavior

It errors. It seems the Node emulation has several bugs in Parcel. See #8409 #8049 #5090

馃拋 Possible Solution

Nothing

馃敠 Context

馃捇 Code Sample

aminya/patha#9

馃實 Your Environment

Software Version(s)
Parcel 2.7.0
Node 18
npm/Yarn pnpm 8
Operating System any
@mischnic
Copy link
Member

mischnic commented Sep 1, 2022

#8387 is going to change this to 1. autoinstall node builtin polyfills into the project root if not already installed and 2. always resolve the polyfills from the project root

@aminya
Copy link
Contributor Author

aminya commented Sep 5, 2022

The build still fails with the same error on 2.0.0-nightly.1162

aminya/patha#9

linden added a commit to JoltzRewards/firebase-proxy that referenced this issue Sep 12, 2022
linden added a commit to JoltzRewards/firebase-proxy that referenced this issue Sep 15, 2022
currently parcel's optimization system removes the `process.env.{REACT_APP_NHOST_SUBDOMAIN, REACT_APP_NHOST_REGION}` call, blocking us from setting nhost to use a different subdomain (related: parcel-bundler/parcel#8433)
@linden
Copy link

linden commented Sep 15, 2022

@aminya I've managed to fix this by adding the --no-optimize flag, I think the optimization system is over-correcting.

@github-actions github-actions bot added the Stale Inactive issues label Mar 15, 2023
@mischnic mischnic removed the Stale Inactive issues label Mar 16, 2023
@parcel-bundler parcel-bundler deleted a comment from github-actions bot Mar 16, 2023
@github-actions github-actions bot added the Stale Inactive issues label Sep 13, 2023
@aminya
Copy link
Contributor Author

aminya commented Sep 27, 2023

It seems that time solves the issues. 馃槃

@github-actions github-actions bot removed the Stale Inactive issues label Sep 27, 2023
@mischnic
Copy link
Member

Is it actually fixed already or are you referring to the stale bot being overzealous?

@aminya
Copy link
Contributor Author

aminya commented Oct 21, 2023

Not fixed. I was joking

@mischnic mischnic reopened this Oct 22, 2023
@parcel-bundler parcel-bundler deleted a comment from github-actions bot Oct 22, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Apr 20, 2024
@github-actions github-actions bot closed this as completed May 4, 2024
@aminya
Copy link
Contributor Author

aminya commented May 4, 2024

I didn't test to see if this is resolved. Github bot being unhelpful like always

@github-actions github-actions bot removed the Stale Inactive issues label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants