Repository navigation
Description
I updated all my projects to use "@angular/core": "19.1.2" & "@angular/cli": "19.1.3". But now when I start the dev server using "ng serve" and visit the localhost:4200, the nodejs server crashes with the following error:
`
NOTE: Raw file sizes do not reflect development server per-request transformations.
➜ Local: http://localhost:4200/
➜ press h + enter to show help
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^Error: [vite] cannot find entry point module 'file:///D:/<PROJECT_FOLDER>/.angular/vite-root/spa-near-me/@ng/component?c=src%2Fapp%2Fcomponents%2Fheader%2Fheader.component.ts%40HeaderComponent&t=1737401566323'.
at fetchModule (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
at async handleInvoke (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
at async EventEmitter.listenerForInvokeHandler (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19) {`All my projects are using tailwind CSS and I've also enabled
provideExperimentalZonelessChangeDetection().This problem goes away if I use
ng serve --no-hmr.Here are my dependencies
"dependencies": { "@angular/animations": "^19.1.2", "@angular/common": "^19.1.2", "@angular/compiler": "^19.1.2", "@angular/core": "^19.1.2", "@angular/forms": "^19.1.2", "@angular/platform-browser": "^19.1.2", "@angular/platform-browser-dynamic": "^19.1.2", "@angular/platform-server": "^19.1.2", "@angular/router": "^19.1.2", "@angular/ssr": "^19.1.3", "express": "^4.18.2", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" }, "devDependencies": { "@angular-devkit/build-angular": "^19.1.3", "@angular/cli": "^19.1.3", "@angular/compiler-cli": "^19.1.2", "@types/express": "^4.17.17", "@types/jasmine": "~5.1.0", "@types/node": "^18.18.0", "autoprefixer": "^10.4.20", "daisyui": "^4.12.23", "jasmine-core": "~5.5.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "lucide-angular": "^0.473.0", "postcss": "^8.5.1", "prettier": "^3.4.2", "tailwindcss": "^3.4.17", "typescript": "~5.7.2", "xmlbuilder": "^15.1.1" }
Activity
[-]Error: [vite] cannot find entry point module 'file:///D:/<PROJECT_FOLDER>/.angular/vite-root/spa-near-me/@ng/component?c=src%2Fapp%2Fcomponents%2Fheader%2Fheader.component.ts%40HeaderComponent&t=1737401566323' on Windows[/-][+]`Error: [vite] cannot find entry point module 'file:///D:/<PROJECT_FOLDER>/.angular/vite-root/spa-near-me/@ng/component?c=src%2Fapp%2Fcomponents%2Fheader%2Fheader.component.ts%40HeaderComponent&t=1737401566323'`on Windows[/+]atsjo commentedon Jan 21, 2025
similar problem for me... I think 'angular-calendar' is including the problematic import in my repo, never had a problem with it before. It works with latest cli (19.1.3), but not with latest angular (19.1.2). Downgrading angular to 19.1.1 fixes it...
[vite] Pre-transform error: Failed to resolve import "angular-draggable-droppable" from ".angular/vite-root/devtest/main.js". Does the file exist?
Plugin: vite:import-analysis
File: D:/repos/teve-no/task4s/.angular/vite-root/devtest/main.js:6386:23
6384| import * as i79 from "@angular/material/icon";
6385| import * as i87 from "angular-calendar";
6386| import * as i96 from "angular-draggable-droppable";
| ^
6387| import * as i104 from "angular-resizable-element";
6388| function tvCalendarComponent_Case_25_Template(rf, ctx)
Laffery commentedon Jan 21, 2025
+1
fix(@angular/build): correct path for `/@ng/components` on Windows
Nevada-Way commentedon Jan 21, 2025
I created a new deafult app, only ( just html hello ) and when i ran ng serve got same error:
Error: [vite] cannot find entry point module 'file:///D:/0.Create/Angular/ssr-hello/ssrhello/.angular/vite-root/ssrhello/@ng/component?c=src%2Fapp%2Fapp.component.ts%40AppComponent&t=1737451488230'.
at fetchModule (file:///D:/0.Create/Angular/ssr-hello/ssrhello/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
at async handleInvoke (file:///D:/0.Create/Angular/ssr-hello/ssrhello/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
at async EventEmitter.listenerForInvokeHandler (file:///D:/0.Create/Angular/ssr-hello/ssrhello/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19) {
runnerError: Error: RunnerError
at reviveInvokeError (file:///D:/0.Create/Angular/ssr-hello/ssrhello/node_modules/@angular/build/node_modules/vite/dist/node/module-runner.js:541:18)
at Object.invoke (file:///D:/0.Create/Angular/ssr-hello/ssrhello/node_modules/@angular/build/node_modules/vite/dist/node/module-runner.js:624:15)
}
using ng serve --no-hmr bypasses this error because I beleive the source of the issue is in the Hot Module Replacement (HMR)
fix(@angular/build): correct path for `/@ng/components` on Windows
fix(@angular/build): correct path for `/@ng/components` on Windows
[-]`Error: [vite] cannot find entry point module 'file:///D:/<PROJECT_FOLDER>/.angular/vite-root/spa-near-me/@ng/component?c=src%2Fapp%2Fcomponents%2Fheader%2Fheader.component.ts%40HeaderComponent&t=1737401566323'`on Windows[/-][+]`Error: [vite] cannot find entry point module 'file://...'` on Windows[/+][-]`Error: [vite] cannot find entry point module 'file://...'` on Windows[/-][+]`Error: [vite] cannot find entry point module 'file://...'` on Windows with SSR[/+]ahmedmohamedrashad01 commentedon Jan 22, 2025
I have the same issue, but if I run this command ng s -o --no-hmr
the app is working fine without any issue
quedicesebas commentedon Jan 24, 2025
Not fixed for me.
alan-agius4 commentedon Jan 24, 2025
@quedicesebas please provide the output of
ng version.quedicesebas commentedon Jan 24, 2025
Angular CLI: 19.1.4
Node: 20.15.0
Package Manager: npm 10.8.1
OS: win32 x64
Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router
Package Version
@angular-devkit/architect 0.1702.3
@angular-devkit/build-angular 19.1.4
@angular-devkit/core 17.2.3
@angular-devkit/schematics 19.1.4
@angular/cli 19.1.4
@angular/fire 19.0.0
@angular/google-maps 19.1.1
@angular/ssr 19.1.4
@schematics/angular 19.1.4
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
But correction. The error is not shown, but the app is not loading, showing
Cannot GET /in the browser. If I press F5 (reload), loads normally :Salan-agius4 commentedon Jan 24, 2025
@quedicesebas, that seems unrelated to this, we haven’t had similar reports. Please file a new issue with a minimal reproduction. Thanks.
gnibeda commentedon Jan 27, 2025
Maybe I have a different case. I need SSR only for prod build, but not in dev mode.
In my case I've got the same error due to CLI trying to access
src/main.server.tswith disabled SSR.Solved it by moving
"server": "src/main.server.ts",to production configuration.Details:
in
angular.jsonI've setssrto false for development configuration:CLI still tries to access
src/main.server.ts(why in the name of god, if ssr is disabled in configuration???)So I've moved
"server": "src/main.server.ts",fromarchitect/build/optionstoarchitect/build/configurations/production.Now
ng serveworks fine and doesn't try to accesssrc/main.server.ts.CarlosTorrecillas commentedon Feb 3, 2025
@gnibeda Thanks, that worked for me! It looks like if you have disabled SSR you have to move the related configuration to the section that is really using it, PROD. I had the exact same use case and it now works
angular-automatic-lock-bot commentedon Mar 6, 2025
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.