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 Angular 6 #753

Closed
lucax88x opened this Issue May 4, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@lucax88x
Copy link

lucax88x commented May 4, 2018

Using any browser, by just performing a login with this library we get this error:

image

@lucax88x

This comment has been minimized.

Copy link
Author

lucax88x commented May 4, 2018

as temporary workaround for any that reach this page you can add

(window as any).global = window;

in polyfill.ts

@luisrudge

This comment has been minimized.

Copy link
Member

luisrudge commented May 5, 2018

Thanks for the workaround. At this point, the angular community will have to come with a solution for this problem, since we're hardly the only library using global. This was already discussed in #748. Moving away from using global means a huge refactor in auth0.js and it's not something we'll actively work on in the near future.

@luisrudge

This comment has been minimized.

Copy link
Member

luisrudge commented May 6, 2018

More context on the angular change here: angular/angular-cli#9827 (comment)

@fetis

This comment has been minimized.

Copy link
Contributor

fetis commented May 18, 2018

@luisrudge would you be happy with a fix like this in your windows.js

  function getWindow() {
    return global ? global.window : window;
  }

and refactor some code to use getWindow exclusively. I noticed in other places you also use global.window to get the window object.

I can prepare PR in that case.

@luisrudge

This comment has been minimized.

Copy link
Member

luisrudge commented May 21, 2018

@fetis I think this is a bigger change than you think, but if you want to go for it, I'll review and test your PR 🎉

@tinyweasel

This comment has been minimized.

Copy link

tinyweasel commented Nov 27, 2018

Workaround doesn't workaround for me.

@fetis

This comment has been minimized.

Copy link
Contributor

fetis commented Nov 27, 2018

@tinyweasel you don't need workaround anymore. it's fixed since v9.6.1

@tinyweasel

This comment has been minimized.

Copy link

tinyweasel commented Nov 28, 2018

I just upgraded to Angular 7 and it's happening to me though. What should I update to fix it?

@fetis

This comment has been minimized.

Copy link
Contributor

fetis commented Nov 29, 2018

@tinyweasel could you plz provide reproduction code and libs versions plz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment