-
Notifications
You must be signed in to change notification settings - Fork 553
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 BUG: Wrangler + Angular SSR (prerender: false) + Private properties = TypeError: Class constructor t cannot be invoked without 'new'
#5263
Comments
TypeError: Class constructor t cannot be invoked without 'new'
TypeError: Class constructor t cannot be invoked without 'new'
The issue arises when re-running esbuild on an already bundled output, as it appears esbuild is incorrectly updating the references. Angular CLI code: let M = class M {
get hasRequestedNavigation() {
return this.navigationId !== 0;
}
constructor() {
//
}
complete() {
this.transitions?.complete();
}
handleNavigationRequest(n) {
let i = ++this.navigationId;
this.transitions?.next(M(Object.assign(Object.assign({}, this.transitions.value), n), { id: i }));
} Wrangler Code: let t13 = class t {
get hasRequestedNavigation() {
return this.navigationId !== 0;
}
constructor() {
//
}
complete() {
this.transitions?.complete();
}
handleNavigationRequest(n) {
let i = ++this.navigationId;
this.transitions?.next(t(s(s({}, this.transitions.value), n), { id: i }));
} The problem lies in the Certainly, resolving this issue would indeed require further investigation to determine the best course of action and probably provide a minimal reproduction to esbuild folks. In this case, using a private field causes the problem because the private field is downleveled to a |
Update: I managed to create a minimal reproduction and created an issue in the esbuild tracker. |
Which Cloudflare product(s) does this pertain to?
Pages
What version(s) of the tool(s) are you using?
2.14.2 [create-cloudflare]
What version of Node are you using?
20.11.1
What operating system and version are you using?
macOS Sonoma 14.4
Describe the Bug
Observed behavior
I noticed that:
npm create cloudflare@latest my-angular-app -- --framework=angular
, an Angular SSR app is created with additional files and changes to make it work with Cloudflare Workers/Pages."prerender": true
onangular.json
)"prerender": false
), so everything is Server Side Rendered (SSR), and add a private property, things break.Expected behavior
SSR should just work and not break with private properties.
Steps to reproduce
npm create cloudflare@latest my-angular-app -- --framework=angular
"prerender": false
onangular.json
#test = 'test'
)npm run start
and pressb
cc: @petebacondarwin @alan-agius4 @JeanMeche
Please provide a link to a minimal reproduction
https://github.com/nunoarruda/my-angular-app
Please provide any relevant error logs
The text was updated successfully, but these errors were encountered: