Closed nvahalik closed 5 years ago
global
is the node global, and every bundler by default changes this to window
for browsers.
Perhaps you've deviated from the default settings by adding node: false
to your webpack config?
My current use case is with Ionic v4. Angular builds the app just fine and this problem only happens during runtime.
Building the app "just fine" would include transforming global
to window
for the browser, like every bundler has done since node has existed. I'm not familiar with Ionic specifically.
@ljharb Apparently for Angular CLI this is no longer the case:
https://github.com/angular/angular-cli/issues/9827#issuecomment-369578814
Angular used to provide a shim for global
but as of 6.x, it is not anymore.
Closing this ticket out since the problem is actually in the has-symbol
module.
Then Angular has chosen to make much of the ecosystem incompatible ¯_(ツ)_/¯
In
v1.15.0
,GetIntrinsic.js
started usinghas-symbols
:https://github.com/ljharb/es-abstract/blob/master/GetIntrinsic.js#L16
When called in a non-node environment, it causes an error since it is referencing
global
:I have confirmed that reverting to
v1.14.2
fixes the issue.