-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
global is not defined #11
Comments
global is always defined in node, this is a node module, and bundlers should be transforming globsl to window for browsers. If your bundler isn’t doing that, please file an issue on it so it can be fixed. |
Why not just writing browser friendly check? I've been suffered from this. |
@JounQin This package is a node module, and is explicitly not intended to be used anywhere but in node, or in a browser via a properly working node module bundler - which requires that it support |
Maybe you're right, but by just adding |
All that would achieve is to make it slightly easier for bundlers to do the wrong thing. You'll still find yourself suffering due to another package - it'd just move the problem. That said, it's fair that the typeof version would work identically, so I suppose I'll go ahead and do it. I strongly suggest you also spend effort trying to fix the broken node module bundlers that fail to polyfill |
Hello,
I use vuepress (Vuejs) that use library using has-symbols, an error occured:
global is not defined
in the library scriptSo to correct it, I add in my scripts
I see that this error is throwed with angular also, so it looks that more and more framework doesn't support global 😉
Can you add a check on window.global to avoid create an error when it isn't define ?
Just emit a default value when not defined ?
Thank you 😃 😄
Have a nice day and be happy !
Kévin
The text was updated successfully, but these errors were encountered: