-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error When Running ng serve Since Version 18.1.0-next.1 : Pre-transform error: Failed to load url ./main.server.mjs (resolved id: ./main.server.mjs). Does the file exist #27907
Comments
…ling Replacing the paths to ESM in Vite can cause prebundling to fail in some cases, resulting in errors similar to the following: ``` 12:55:12 PM [vite] Error when evaluating SSR module /chunk-CHB4JJIP.mjs: |- TypeError: Cannot read properties of undefined (reading 'Subject') at eval (//src/app/shared/snackbar/snackbar.service.ts:2:25) at async instantiateModule (file:////node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53408:5) 12:55:12 PM [vite] Error when evaluating SSR module /chunk-GQZ5BKXC.mjs: |- TypeError: Cannot read properties of undefined (reading 'Subject') at eval (//src/app/shared/snackbar/snackbar.service.ts:2:25) at async instantiateModule (file:////node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53408:5) ``` Closes: angular#27907
…ling Replacing the paths to ESM in Vite can cause prebundling to fail in some cases, resulting in errors similar to the following: ``` 12:55:12 PM [vite] Error when evaluating SSR module /chunk-CHB4JJIP.mjs: |- TypeError: Cannot read properties of undefined (reading 'Subject') at eval (//src/app/shared/snackbar/snackbar.service.ts:2:25) at async instantiateModule (file:////node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53408:5) 12:55:12 PM [vite] Error when evaluating SSR module /chunk-GQZ5BKXC.mjs: |- TypeError: Cannot read properties of undefined (reading 'Subject') at eval (//src/app/shared/snackbar/snackbar.service.ts:2:25) at async instantiateModule (file:////node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53408:5) ``` Closes: #27907
@alan-agius4 is it fixed it |
@naveedahmed1, yes and I am no longer able to replicate. |
Have you tried it on Windows machine? |
I was able to replicate the issue on Windows and have submitted a pull request to address it: #27946 |
Thank you so much Alan! |
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. |
Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Since version
18.1.0-next.1
I am receiving the below error when runningng serve
, whereasng serve --configuration production
seems to be working fine.9:37:49 pm [vite] Pre-transform error: Failed to load url ./main.server.mjs (resolved id: ./main.server.mjs). Does the file exist?
Below is my
package.json
file:Minimal Reproduction
@alan-agius4 you can reproduce it in the private repo I have shared earlier.
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: