Skip to content
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

BUG: global is not defined since angular v6 #208

Closed
mischahaenen opened this issue Jan 21, 2021 · 4 comments
Closed

BUG: global is not defined since angular v6 #208

mischahaenen opened this issue Jan 21, 2021 · 4 comments

Comments

@mischahaenen
Copy link

Hello @contributors
I am currently using your great project to convert cron expressions. When I've installed it, I had the error that global was not defined. I had a small workaround for this bug. I defined global myself in polyfills.ts. with (window as any).global = window;. Since angular v6, global is not defined by default. I was looking for another solution but found none, but I came across this comment:
angular/angular-cli#9827 (comment)
So is there a way that you can provide the global context? I think I'm not the only angular developer which faces this problem. And a solution from your side would save much time and saves some frustrated developers.
Thanks for your great work! 🚀

@harrisiirak
Copy link
Owner

@mischahaenen hi!

I'm not very familiar with Angular application build process anymore, at least it seems to be build process related issue. cron-parser itself doesn't use any global/window context as such, therefore I'm not completely sure what can be fixed from this side.

@amiram
Copy link
Contributor

amiram commented Aug 16, 2021

@harrisiirak I think this is by mistake. cron-parser is using this tree:
is-nan -> call-bind -> get-intrinsic -> has-symbols

has-symbols is using global in index.js:

var origSymbol = global.Symbol;

However, I didn't see any usage of is-nan in cron-parser code. Can this dependency be removed?

This was referenced Aug 17, 2021
@amiram
Copy link
Contributor

amiram commented Aug 17, 2021

@harrisiirak My mistake. It is used, but is it replaceable by something else? or do you know a way to override that in browser?

@harrisiirak
Copy link
Owner

@amiram is-nan is used but I think we can remove this dependency and rely on built-in Number.isNaN .

amiram added a commit to amiram/cron-parser that referenced this issue Aug 31, 2021
harrisiirak pushed a commit that referenced this issue Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants