parcel icon indicating copy to clipboard operation
parcel copied to clipboard

Unable to make `typeof process !== 'undefined'` false

Open maxburs opened this issue 1 year ago • 1 comments

🐛 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.

maxburs avatar Feb 28 '24 00:02 maxburs

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[bot] avatar Aug 26 '24 12:08 github-actions[bot]