-
Notifications
You must be signed in to change notification settings - Fork 12k
ng serve breaks with mutliple bootstrapped modules #7605
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
@snewell92 can you just pass multiple components to bootstrap in one root module? |
@hansl is this usecase supported? AFAIK we only support a single entry module. |
@deebloo I tried that at first, but for some reason switched to bootstrapping different modules for some reason. Trying that again... Ah I remember
When specifying bootstrapped components in a module those components need their selector to exist in the DOM, but when bootstrapping a module in a main file/entry-point that is not the case. @filipesilva I would like to turn this into a feature request/bug report if this usecase is not supported. Bug report because there should still be an error even when commenting out/in the bootstrapped modules, feature request because it simplifies a multi-page development workflow a ton. My use case explained more in depthI'm developing a full-stack multi-page application with a node backend, so each page has its own root page module. The node backend leverages SSR (with another tool, not angular) to get the skeleton of the page, with script tags pointing to either the development server ng serve starts, or the production hosting service (like netlify) in prod. This works well when building the application ( Thanks for reading and taking the time to respond <3<3 |
A more ''supported" way of doing this is to have a dev module in which the component is simply a router shell (template is just Regardless, |
I think this is a variation of #4624. |
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. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
ng new test-app
main.ts
bootstrap bothng serve
(not statically analyzable?)ng serve
againThe log given by the failure.
Desired functionality.
ng serve
should be able to see that there are two bootstraps and handle that. This is super useful in multi-page applications to have a development environment, while supporting full separate apps in production.Mention any other details that might be useful.
Could be related to #4624
The text was updated successfully, but these errors were encountered: