Closed
Description
In v1.15.0
, GetIntrinsic.js
started using has-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
:
Uncaught (in promise): ReferenceError: global is not defined
./node_modules/has-symbols/index.js@http://my-app-here:2024:18
__webpack_require__@http://localhost:8100/runtime.js:84:30
./node_modules/es-abstract/GetIntrinsic.js@http://my-app-here:749:18
__webpack_require__@http://localhost:8100/runtime.js:84:30
./node_modules/es-abstract/es5.js@http://my-app-here:937:20
__webpack_require__@http://localhost:8100/runtime.js:84:30
./node_modules/string.prototype.trim/implementation.js@http://my-app-here:14204:10
__webpack_require__@http://localhost:8100/runtime.js:84:30
I have confirmed that reverting to v1.14.2
fixes the issue.
Metadata
Metadata
Assignees
Labels
No labels
Activity
ljharb commentedon Oct 17, 2019
global
is the node global, and every bundler by default changes this towindow
for browsers.Perhaps you've deviated from the default settings by adding
node: false
to your webpack config?nvahalik commentedon Oct 17, 2019
My current use case is with Ionic v4. Angular builds the app just fine and this problem only happens during runtime.
ljharb commentedon Oct 17, 2019
Building the app "just fine" would include transforming
global
towindow
for the browser, like every bundler has done since node has existed. I'm not familiar with Ionic specifically.nvahalik commentedon Oct 22, 2019
@ljharb Apparently for Angular CLI this is no longer the case:
angular/angular-cli#9827 (comment)
Angular used to provide a shim for
global
but as of 6.x, it is not anymore.nvahalik commentedon Oct 22, 2019
Closing this ticket out since the problem is actually in the
has-symbol
module.ljharb commentedon Oct 22, 2019
Then Angular has chosen to make much of the ecosystem incompatible ¯_(ツ)_/¯