-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Page loading issue with Angular 2 #303
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
Comments
I think I got things working by changing the timing of the script load. Loading it earlier (before some of the other scripts) seems to help. Still not sure why that would matter, but for now I'll go ahead and close this. Thanks. |
That shouldn't happen. Did you reproduce this issue with a basic app ? |
Got the same problem, this issue should be re-opened. It seems that the page loading problem appears when |
Please reopen. I have the same problem. If i include JSZip before zone.js it works, if i include it after zone.js angular stops working. I tried to figure out where the problem is and guess perhaps it has something to do with promises. Until Step 4. "Multiple Components" everything is fine. |
Careful though. Zone does a lot of crazy stuff, so it's certainly possible that the issue is with Zone and not JSZip. However, Zone is being used/beaten on/tested by a lot of people, so one would hope that a problem like this would be noticed if it were indeed with Zone. |
I was thinking of a conflict between zone and jszip, so the error could be on both sides. I was thinking of zone and jszip perhaps defining different things to the name "Promise". (I'm far from an javascript expert so i don't know if this thought is helpful) But i played a little with the jszip source and changed 2 lines here: comment out line 298: change line 295: so i assume Promise must be defined global or before, but with this changes the error is gone, at least for me. |
@moritz-h you're right ! Zone.js overwrites the global |
Importing `es6-promise` had a side effect: this library replaces the global Promise object (Stuk#304) (or tries to, Stuk#309). This is an intended side effect from this library and while its version 4 should give us a switch for this behavior, I don't know when it will be out (the master branch of this project still auto replace the Promise). I replaced it by `vow` which match the requirements: - a Promise implementation - a lightweight one - works in IE6 - doesn't have too many dependencies If a global Promise already exists, prefer it: a native promise is likely to be better integrated anyway (unhandledRejection in node) and some libraries (zone.js for example) replace global objects (Stuk#303). I think it is enough for a semver minor version. Fix Stuk#303 Stuk#304 Stuk#309
Fixed in v3.1.0. |
I've got an Angular 2 app (based on https://github.com./mgechev/angular2-seed). Testing in the latest Chrome release. Everything is working fine until I include the jszip (or jszip.min) script. When I load the page with jszip included, rendering of the whole app just stops. If I take jszip back out, everything works again. I'm not even doing anything with JSZip yet. Simply loading the library triggers this.
Unfortunately, there are no errors thrown, so I really have no idea what the problem is. So I don't have a lot of information to provide on this, but I thought I'd add an issue in case this rings any bells with the folks running the project. I'm not sure why jszip (which I would assume has no UI interaction built into it all) would cause a problem (and a "silent" problem at that) with application loading. If anyone has any ideas, I'm all ears.
If I can, I'll try to replicate it in a more basic app.
The text was updated successfully, but these errors were encountered: