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
Angular elements does't run in production #44128
Comments
|
Ok this is really WEIRD. I added some logs to the AppModule of the Widgets build: And this is what i get (both production build): Seems like the scripts in the index.html are being executed TWICE??? I am honestly really interestied in what is going on here P.S. @gcherem
cheers |
|
I believe this is essentially a duplicate of #23732. That is an old issue and the specifics might be outdated, but the general idea of the problem still holds: Fundamentally, this is a packaging/bundling issue and our tooling does not currently support this usecase. In the mean-time, you probably have to rely on some 3rd-party tools and custom configs. I am going to close this issue, since the general problem of being able to more easily consume independently built Angular Elements is being tracked in #25421. |
Naa. My gut feeling tells me there are solutions with plain angular toolchain. Even for angular elements. But could also be just some flatulences P.S. Plain angular toolchain solution cheers |
|
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. |




Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
Angular Element (https://angular.io/guide/elements) doesn't run in production. If both host application and element application have the
--prodflag, you are going to see the error bellow. Otherwise (at least one of them without--prodflag), everything works fine.Please provide a link to a minimal reproduction of the bug
https://github.com/gcherem/problem-with-elements
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
Yes. The repository https://github.com/gcherem/problem-with-elements has both host (host application) and widget (angular element).
I used Web Server for Chrome for the widget.
If you run the host app with
start-prodand the widget withbuild-prod, you are going to see the error. If you run the host withstartor the widget withbuild, everything will work.The text was updated successfully, but these errors were encountered: