-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
I'm using url-parse within an Angular 6 (angular-cli) app.
Within url-parse, there's a place where it's looking for global, which does not exist in a browser environment:
Line 53 in da8cddb
| var location = global && global.location || {}; |
In Angular 6 CLI, they removed webpack features that added a shim for global in a browser environment: angular/angular-cli#9827
When url-parse runs in the browser without the shim, I get ERROR ReferenceError: global is not defined
If I manually add a shim, for example <script>window.global = {};</script> in the head, it works.
It seems like a simple addition of a definition check for global would fix it longer term, such as:
typeof global !== 'undefined' && global.location || {};
Metadata
Metadata
Assignees
Labels
No labels