Skip to content
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 19.1.3 SSR Vite Crash on every reload HMR disabled #29443

Closed
1 task done
us77ipis opened this issue Jan 22, 2025 · 4 comments · Fixed by #29462 or #29544
Closed
1 task done

Angular 19.1.3 SSR Vite Crash on every reload HMR disabled #29443

us77ipis opened this issue Jan 22, 2025 · 4 comments · Fixed by #29462 or #29544
Assignees

Comments

@us77ipis
Copy link

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

After updating from 19.0.x to 19.1.3 even with HMR disabled ng serve crashes any time I update any file.

Looks similar to #29424, but happens also with HMR disabled.

Minimal Reproduction

Run ng serve --no-hmr

Exception or Error

[vite] (ssr) Error when evaluating SSR module /main.server.mjs:
|- Error: [vite] cannot find entry point module '/main.server.mjs'.
    at fetchModule (file:///app/frontend/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async handleInvoke (file:///app/frontend/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
    at async EventEmitter.listenerForInvokeHandler (file:///app/frontend/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19)

An unhandled exception occurred: [vite] cannot find entry point module '/main.server.mjs'.

Your Environment

Angular CLI: 19.1.3
Node: 22.12.0
Package Manager: npm 10.9.0
OS: linux x64

Angular: 19.1.2
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.3
@angular-devkit/build-angular   19.1.3
@angular-devkit/core            19.1.3
@angular-devkit/schematics      19.1.3
@angular/cdk                    19.1.0
@angular/cli                    19.1.3
@angular/material               19.1.0
@angular/ssr                    19.1.3
@schematics/angular             19.1.3
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

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 ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Jan 22, 2025
@us77ipis
Copy link
Author

I'll continue trying to create a minimal example, though I have not achieved reproduction of the issue starting with a fresh project so far.

Here the ng version output from before the update that caused the issue, in case that helps:

Angular CLI: 19.0.4
Node: 22.12.0
Package Manager: npm 10.9.0
OS: linux x64

Angular: 19.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.4
@angular-devkit/build-angular   19.0.4
@angular-devkit/core            19.0.4
@angular-devkit/schematics      19.0.4
@angular/cdk                    19.0.4
@angular/cli                    19.0.4
@angular/material               19.0.4
@angular/ssr                    19.0.4
@schematics/angular             19.0.4
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

@rmlira
Copy link

rmlira commented Jan 23, 2025

same issue here, for a new project I just have included the app-shell:

ng generate app-shell

and then created a lazy loaded route:

export const routes: Routes = [
  {
		path: '',
		children: [
			{
				path: '',
				loadComponent: () => import('./home/home.component').then((m) => m.HomeComponent),
				title: 'Welcome Home',
			},
		],
	}
];

every time I edit the homeComponent it throws me the same error:

[error] Error: [vite] cannot find entry point module '/main.server.mjs'.
    at fetchModule (file:///C:/Users/myUser/Documents/Workspace/Intern/temp/ng/tai/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleInvoke (file:///C:/Users/myUser/Documents/Workspace/Intern/temp/ng/tai/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
    at async EventEmitter.listenerForInvokeHandler (file:///C:/Users/myUser/Documents/Workspace/Intern/temp/ng/tai/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19)

configuration:

Angular CLI: 19.1.4
Node: 20.17.0
Package Manager: npm 10.8.2
OS: win32 x64

Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.4
@angular-devkit/build-angular   19.1.4
@angular-devkit/core            19.1.4
@angular-devkit/schematics      19.1.4
@angular/cli                    19.1.4
@angular/ssr                    19.1.4
@schematics/angular             19.1.4
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

new project commands;

ng new --create-application false --new-project-root apps --package-manager npm --skip-git --skip-install --strict

ng generate application appTest --strict --skip-install --style=css --ssr=N

@us77ipis
Copy link
Author

Still having this issue with 19.1.5, so #29462 did not fix the issue I believe.

Angular CLI: 19.1.5
Node: 22.13.1
Package Manager: npm 10.9.2
OS: linux x64

Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.5
@angular-devkit/build-angular   19.1.5
@angular-devkit/core            19.1.5
@angular-devkit/schematics      19.1.5
@angular/cdk                    19.1.1
@angular/cli                    19.1.5
@angular/material               19.1.1
@angular/ssr                    19.1.5
@schematics/angular             19.1.5
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

@alan-agius4 alan-agius4 reopened this Jan 30, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 30, 2025
…r features are enabled

This change ensures that the server manifest is not generated if none of the server-related features are enabled.

Closes angular#29443
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 30, 2025
…r features are enabled

This change ensures that the server manifest is not generated if none of the server-related features are enabled.

Closes angular#29443
alan-agius4 added a commit that referenced this issue Jan 30, 2025
…r features are enabled

This change ensures that the server manifest is not generated if none of the server-related features are enabled.

Closes #29443

(cherry picked from commit 9b0d730)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment