-
Notifications
You must be signed in to change notification settings - Fork 12k
Build Optimizer [es2015] "ReferenceError: Must call super constructor" issue with lazy-loaded modules #14416
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
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
Does this error disappear if you disable Build Optimizer? Ie using:
|
@alan-agius4 Yes, my current workaround was to set buildOptimizer to Yeah, I wasn't sure if I needed to since this issue seems to have lingered for a long time so I'm sure some people are well-aware of it -- this is just slightly deeper manifestation of it. Either way, I'll see if I can find time to set up something up. |
OK, it took me 4 hours but I think I found the root cause, or at least the way to reproduce exactly. I've created a repository to reproduce it, all explanations are in the readme file there. https://github.com/shlomiassaf/angular-cli-build-optimizer-es2015-issue Ohh boy, this one was tricky. TLDR: It will only happen if the class is built in I.E: Angular packages built with I don't think it's related to lazy loading... |
Hi @shlomiassaf, this seems related to this issue #14084 which should be able to solve the above in version 8. |
@alan-agius4 Is it possible to patch 7 with this change as well? or tsickle was only removed in 8? Seems like a small change... |
Thanks for taking the time to reproduce it @shlomiassaf! It looks like it was the same root cause as #14084 so #14263 closes this issue as well. I don't think we'll be backporting it to 7 as backporting is usually reserved for high impact security issues. Instead we recommend updating to 8 to fix this. |
Why not? In my company we can't update to a8 instantly. And still wanna use Angular and ng library. Please add fic in a7. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This is a Bug Report:
This issue seems to be well-described and well-documented here (and in related posts -- but maybe not fully fixed): #12112
As per request to another individual in that thread, I am making a new issue.
Everything continues to work fine locally and compile and/or build fine and I didn't notice the issue in full builds before, but when I added a lazy-loaded module and then did a build with
ng build --prod --aot --configuration=prod
, when I loaded the application and then tried to access the lazy-loaded module, I was met with the following error:My ng version:
My tsconfig.json:
My angular.json:
The text was updated successfully, but these errors were encountered: