Reputation: 25
My Angular App is working on Chrome but not on Firefox. Not sure what I did, it's now getting stuck at loading, and there's no error message. When I use FireFox, it pops up a Warning: Unresponsive Script
"A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
I searched for this lost not found any sufficient reply.
There is no for loop also in my code because of which it can stuck in infinite loop.
As I am new to angular, ask if any other thing is needed to solve this problem please help me to solve this problem.
Upvotes: 0
Views: 1624
Reputation: 1103
We faced the same issue with our Angular 4 project. It is rather large (minified app.js is over 2MB) and it takes Angular about 8-10 seconds to compile the code using the JIT compiler. This lengthy compilation time is what causes Firefox to complain. What you can do is switch to the AOT (Ahead Of Time) compiler which basically compiles the code at build-time rather than at load time. In our case it reduced the load time of the complete webpage to 2-3 seconds.
The AOT compiler is very strict compared to the JIT compiler and it took me about a day to fix all the compilation errors. So be prepared to spend a lot of time on changing it.
Some information to help:
Helpfull tutorial if you use webpack
Upvotes: 1