You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just had the same problem. It seems that the url-parse/index.js doesn't define global. If you import the UMD, it works even though it is hacky to not import the main directly: import * as urlParse from 'url-parse/dist/url-parse';
I'm using
url-parse
within an Angular 6 (angular-cli) app.Within
url-parse
, there's a place where it's looking forglobal
, which does not exist in a browser environment:url-parse/index.js
Line 53 in da8cddb
In Angular 6 CLI, they removed webpack features that added a shim for
global
in a browser environment: angular/angular-cli#9827When
url-parse
runs in the browser without the shim, I getERROR 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:The text was updated successfully, but these errors were encountered: