You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone the above mentioned repo (the repo is created by running npx create-nx-workspace@latest broken-angular-di --preset=angular-standalone and using all default values).
Run npm install
Navigate to: src > app > app.component.ts
You should see linter error on line 16: Property 'appService' is used before its initialization.
View the browser runtime error
Comment out line 9 and line 16 to remove code for linter error example (to avoid breaking the build).
Run nx serve
Press: Ctrl + Shift + J in browser to open console to see the runtime errors.
Current Behavior
TypeError: Cannot read properties of undefined
.Note: Adding
"useDefineForClassFields": false
into thetsconfig.json
file resolves both these issuesExpected Behavior
GitHub Repo
https://github.com/snowmandev/broken-angular-di
Steps to Reproduce
npx create-nx-workspace@latest broken-angular-di --preset=angular-standalone
and using all default values).npm install
Property 'appService' is used before its initialization.
nx serve
Ctrl + Shift + J
in browser to open console to see the runtime errors.Nx Report
Node : 22.11.0
OS : linux-x64
Native Target : x86_64-linux
npm : 10.9.0
nx (global) : 20.0.7
nx : 20.0.7
@nx/js : 20.0.7
@nx/jest : 20.0.7
@nx/eslint : 20.0.7
@nx/workspace : 20.0.7
@nx/angular : 20.0.7
@nx/devkit : 20.0.7
@nx/eslint-plugin : 20.0.7
@nx/web : 20.0.7
@nx/webpack : 20.0.7
typescript : 5.5.4
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Adding
"useDefineForClassFields": false
into thetsconfig.json
file resolves these issues.The text was updated successfully, but these errors were encountered: