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

Unable to make typeof process !== 'undefined' false #9549

Open
maxburs opened this issue Feb 28, 2024 · 0 comments
Open

Unable to make typeof process !== 'undefined' false #9549

maxburs opened this issue Feb 28, 2024 · 0 comments

Comments

@maxburs
Copy link

maxburs commented Feb 28, 2024

馃悰 bug report

process !== globalThis.process when package.json has { "alias": { "process": false } }.

I tried updating package.json#alias.process to resolve to a few different file types: module.export = undefined, export default = undefined,

馃 Expected Behavior

process should resolve the same value as globalThis.process. It should be possible to make typeof process !== 'undefined return false.

馃槸 Current Behavior

Some dependencies, like the Monaco editor, use typeof process !== 'undefined' to check if they're running in node. Setting { "alias": { "process": false } } causes globalThis.process to be false, but process to be an empty object ({}). That's to say, globalThis.process is not the same as process.

馃敠 Context

This has caused problems integrating with the Monaco editor.

sagivf pushed a commit to Azure/monaco-kusto that referenced this issue Feb 28, 2024
- Patch monaco-editor in order to get esm-parcel sample working
  - Aside: Looks like CI didn't catch this?
- Fix both `0.45.0` and `0.46.0` monaco-editor versions resolve in the
repo
- Bumped parcel version
- Replaces `~0.46.0` monaco-editor versions with `^0.46.0` for
consistency, and so we don't need 2 lines in packages.json#resolutions

This seems like more of a Parcel issue than a monaco-editor one, so I've
opened an issue on them:
parcel-bundler/parcel#9549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant