-
Notifications
You must be signed in to change notification settings - Fork 12k
Zoneless SSR doen't build when using file polyfill #28898
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
Comments
I didn't get it. My zoneless SSR app builds just fine with v19. |
@e-oz do you use file based polyfill ? I just noticed I forgot to include the error log so it's here:
Basically for the server side package build the condition that detects whether it should build zone-based or zoneless app is very generic and it matches "zone.js" or any other js/ts file inside the polyfills array. So I suppose even empty file specified in that array inside angular.json build will cause the error. |
I guess that this thing alone will throw an exception on the server side. In my polyfills I have only link to localize. |
Hi @e-oz and @martin-yumsto, |
Do you use poly-fills and ssr too ? EDIT: precision - do you use pollyfils that match following regex |
@martin-yumsto I created a new project with Angular 19 with experimental-zoneless option. I included ssr and insert manually polyfills. am I missing something? if you want add me more info to replicate the bug so in case to work on it. Thanks, at your disposal |
Odd, because I can still see the line of code in master, that caused the issue. What polyfills did you use to replicate ? I'll also double check at the same time |
I have inserted these conf into my project test (Angular 19 + ssr) in the Angular.json: In polyfills.ts I have inserted: maybe I'm doing something wrong to replicate the case? |
Hey @aparzi, that's indeed how I faced it and still do:
Once I add That being said, I'm only running on v19, not v19.1. It introduced some change that breaks my code and I didn't take a look yet why. Let me upgrade first to v19.1 or v19.2 and check whether it still happens. |
Hi @martin-yumsto |
Hi @martin-yumsto, |
I did take a look and have been upgrading since then. Turned out the recent refactoring of i18n breaks my SSR and I'm not having luck with fixing it... but that's another story. |
Hi @alan-agius4, Thanks |
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. |
Which @angular/* package(s) are the source of the bug?
compiler-cli
Is this a regression?
No
Description
I'm trying to go zoneless for my SSR angular app with hydration.
This condition seems to cause difficulties to migrate to zoneless for any SSR app that uses file based polyfills:
angular-cli/packages/angular/build/src/tools/esbuild/application-code-bundle.ts
Line 175 in d622e59
I guess you are aware of the issue, since there is a todo on the condition that feels too generic:
angular-cli/packages/angular/build/src/tools/esbuild/utils.ts
Line 470 in d622e59
Basically it adds
zone.js/node
import for all the builds that have file polyfill.Minimal repro would be:
angular.json:
"polyfills": ["@angular/localize/init", "polyfills.ts"]
polyfills.ts
(window as any).global = window; // Amplify
Please 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
The text was updated successfully, but these errors were encountered: