Skip to content

HMR Vite cannot find /@ng/component entry point module in v19.1.0 SSR #29364

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

Closed
Ruisi-Lu opened this issue Jan 16, 2025 · 2 comments · Fixed by #29365
Closed

HMR Vite cannot find /@ng/component entry point module in v19.1.0 SSR #29364

Ruisi-Lu opened this issue Jan 16, 2025 · 2 comments · Fixed by #29365

Comments

@Ruisi-Lu
Copy link

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

When enabling SSR in an Angular 19.1.0 project, the application throws an error related to Vite not finding the entry point module.
When disable HMR, no throws.

Steps to reproduce the issue:

  1. ng new --ssr
  2. ng serve
  3. Observe the error in the terminal.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Error: [vite] cannot find entry point module 'file:///C:/@ng/component?c=src%2Fapp%2Fapp.component.ts%40AppComponent&t=1737003792335'.
    at fetchModule (file:///C:/Project/test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
    at async handleInvoke (file:///C:/Project/test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
    at async EventEmitter.listenerForInvokeHandler (file:///C:/Project/test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19) {
  runnerError: Error: RunnerError
      at reviveInvokeError (file:///C:/Project/test/node_modules/vite/dist/node/module-runner.js:541:18)
      at Object.invoke (file:///C:/Project/test/node_modules/vite/dist/node/module-runner.js:624:15)
}

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.1.0
Node: 20.18.1
Package Manager: npm 10.8.2
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.0
@angular-devkit/build-angular   19.1.0
@angular-devkit/core            19.1.0
@angular-devkit/schematics      19.1.0
@schematics/angular             19.1.0
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else?

No response

@alan-agius4 alan-agius4 transferred this issue from angular/angular Jan 16, 2025
@alan-agius4 alan-agius4 changed the title Vite cannot find entry point module in v19.1.0 SSR [HMR] Vite cannot find /@ng/component entry point module in v19.1.0 SSR Jan 16, 2025
@alan-agius4 alan-agius4 changed the title [HMR] Vite cannot find /@ng/component entry point module in v19.1.0 SSR HMR Vite cannot find /@ng/component entry point module in v19.1.0 SSR Jan 16, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 16, 2025
Improved handling of Angular prefixed files when using Vite dev-server with SSR. Updated logic ensures proper resolution of `file://` files paths with query strings.

Closes angular#29364
alan-agius4 added a commit that referenced this issue Jan 16, 2025
Improved handling of Angular prefixed files when using Vite dev-server with SSR. Updated logic ensures proper resolution of `file://` files paths with query strings.

Closes #29364

(cherry picked from commit 48385bd)
@alan-agius4
Copy link
Collaborator

The fix has been released and is available in version 19.1.1.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants