Closed msalq closed 2 months ago
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 I think creating a repro with the exact same message might be really hard to come up with. As our application is a very complex and large scale application. However I tried something and Im getting an error that is similar to the error seen in my main application.
Heres the link to the repro: https://github.com/msalq/Angular-SSR-Migration-Bug-Repro
The error I get when ssr serving is "Module not found" which I think is stemming from the same RCA as my main application, just surfacing under a different format.
@msalq, I downloaded the reproduction, but I am not getting any error
alanagius@alanagius-linux ~/Angular-SSR-Migration-Bug-Repro main ng b --no-prerender
Browser bundles
Initial chunk files | Names | Raw size | Estimated transfer size
main-UJVQOKDB.js | main | 216.14 kB | 59.08 kB
polyfills-6EAL64PA.js | polyfills | 34.23 kB | 11.13 kB
styles-5INURTSO.css | styles | 0 bytes | 0 bytes
| Initial total | 250.38 kB | 70.21 kB
Server bundles
Initial chunk files | Names | Raw size
server.mjs | server | 1.11 MB |
chunk-4XE7LDMD.mjs | - | 459.97 kB |
polyfills.server.mjs | polyfills.server | 268.32 kB |
chunk-SWJQVCSS.mjs | - | 24.42 kB |
chunk-44X6ELFP.mjs | - | 1.63 kB |
render-utils.server.mjs | render-utils.server | 219 bytes |
main.server.mjs | main.server | 184 bytes |
Lazy chunk files | Names | Raw size
chunk-TUONMDNT.mjs | xhr2 | 12.08 kB |
Output location: /Angular-SSR-Migration-Bug-Repro/dist/tes
Application bundle generation complete. [4.175 seconds]
alanagius@alanagius-linux ~/Angular-SSR-Migration-Bug-Repro main node /Angular-SSR-Migration-Bug-Repro/dist/tes/server/server.mjs
Node Express server listening on http://localhost:4000
can you run these commands:
ng build
npm run serve:ssr:tes
the bug might go away with the no-prerender tag
also, I just want to highlight how everything was working fine with angular universal, its with ssr that this error has started occuring.
I tried the above commands, and I am still not getting any error.
surprising, what node version are you using?
v18.20.3
I was able to replicate the bug on another machine, so im not really sure how its not happening on your end. We are running on M2 macbook.
@msalq, I also tried this on Mac and I am still unable to replicate used your reproduction.
I'm sorry, but we can't reproduce the problem following the instructions you provided. Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue. Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.
If the problem persists, please open a new issue following our submission guidelines.
A good way to make a minimal repro is to create a new app via ng new repro-app
and add the minimum possible code to show the problem. Then you can push this repository to github and link it here.
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.
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
I encountered an error while upgrading my Angular application from version 14 to version 18. Specifically, during the migration from Angular 16 to 17, Angular Universal was migrated to SSR, which led to changes in the server.ts file. Despite ensuring there are no circular imports, I am unable to resolve the error.
My
server.ts
fileMy
app.server.ts
filePlease provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response