-
Notifications
You must be signed in to change notification settings - Fork 12k
Dev Server throws error when running Angular 17 app non-standalone with SSR #26922
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
The problem is caused because when updated the main.server.ts manually the default export in https://github.com/griest024/ng17-repro/blob/c54b47df03c804f8c39ed290efd930e3e4ff5eb5/src/main.server.ts#L1 has been removed. You could update it the below if you'd also want to keep the named export. export {AppServerModule, AppServerModule as default} from './app/app.server.module'; We should however provide a more actionable error message here. |
…when server bundle is missing default export This change improves the error message when the server bundle does not export a default export. Closes angular#26922
@alan-agius4 That fixed it! Good call. I definitely support a better error message. |
…when server bundle is missing default export This change improves the error message when the server bundle does not export a default export. Closes #26922
this is apparently a requirement: angular/angular-cli#26922
this is apparently a requirement: angular/angular-cli#26922
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. |
Uh oh!
There was an error while loading. Please reload this page.
Command
serve
Is this a regression?
The previous version in which this bug was not present was
16
Description
When running an Angular 17 app with the module setup and SSR enabled, the dev server throws an error.
Building (
ng b
) works (unlessprerender: true
) and serving the client bundle directly works as well as running SSR:node dist/repro-app/server/server.mjs
.With prerender enabled, building throws the same error as the dev server.
Removing SSR (deleting
ssr
andserver
options inangular.json
) causes the dev server to work as expected.Minimal Reproduction
Run
ng s
in my repro.See this branch for a repro of how removing SSR options fixes the issue.
Exception or Error
Your Environment
Anything else relevant?
Maybe this isn't a supported usage since standalone is default now? Seems like modules should still be fully supported until they're officially deprecated.
The text was updated successfully, but these errors were encountered: