-
Notifications
You must be signed in to change notification settings - Fork 12k
Project cannot be build Cannot read properties of undefined (reading 'file')
#25496
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 have the same issue with Angular 14. Maybe related to a babel dependecy which was uploaded an hour ago? |
This seems to be indeed caused by a change (intentional or not) in Babel which is breaking the Angular linker.
|
I am experiencing the same issue. Interestingly, I downgraded to angular 15 globally, and creating a new project results in the same build error. versions in package.json: "dependencies": {
"@angular/animations": "^15.2.0",
"@angular/common": "^15.2.0",
"@angular/compiler": "^15.2.0",
"@angular/core": "^15.2.0",
"@angular/forms": "^15.2.0",
"@angular/platform-browser": "^15.2.0",
"@angular/platform-browser-dynamic": "^15.2.0",
"@angular/router": "^15.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.2.9",
"@angular/cli": "~15.2.9",
"@angular/compiler-cli": "^15.2.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.9.4"
} |
A temporary fix would be: "@babel/generator": "7.22.5", |
I have the same issue with |
Cannot read properties of undefined (reading 'file')
I have same issue on |
same here with v16 :( |
Getting same issue in Angular 15.2.9 |
As suggested here - Can you try and add this to package.json |
Getting the same issue with latest Angular v14 ( |
live example for angular also failing with the same error |
Cannot read properties of undefined (reading 'file')
Cannot read properties of undefined (reading 'file')
use pnpm i and found this waring, use the overrides and it fixed
|
Same for us (latest Angular 13) |
I am also facing the same issue when I created new project but for older created projects the issue is not there. |
I have the same issue and I tried the : on package.json but is not working |
try deleting node_modules and |
I tried tha also, the issue is still there :( |
I also tried by deleting node_modules and npm install and then ng serve, but it's not working for me too |
Wait 10 minutes, I'm releasing a Babel patch (7.22.8 of |
strange, worked for me btw |
I'm also facing the same issue with |
This issue has been caused Please ensure to remove NPM "overrides" and Yarn "resolutions" from your
Windows users:
If after the above you are are still encountering this problem and you are not using the public NPM repository, make sure that your NPM mirror is synced. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Babel 7.22.8 released -- the steps listed in the original issue description (#25496 (comment)) now succesfully create and build an Angular project. Please make sure to update |
This comment was marked as resolved.
This comment was marked as resolved.
I can confirm that it works now with the new version of babel traverse (automatically installed, no need to change anything to the original config) |
This comment was marked as resolved.
This comment was marked as resolved.
Closing as this issue has been resolved upstream and confirmed that the fix works. |
quick reaction. gj and ty |
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
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Building a new Angular 16.1.0 project via @angular/cli fails.
The project was not modified after creation!
Minimal Reproduction
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: