-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Metadata version mismatch for module #4401
Comments
Wanted to post the same. Strangely the following works for me: Still I think that this problem needs a fix. |
Just to confirm what @kolomu said. it happened to me, and I tested this. |
The same thing happened to me when I upgraded my project to Angular 5 and then upgraded to primeNG 5.0.0-rc.0. Any idea on how to fix the issue? The weird thing in my case is that in my app's package.json I see the following version of @angular dependencies: Example" But in the package.json of the primeng module I see the following: Example" |
Yeah it is indeed the version mismatch. I had This fixed the issue for me |
@Mitta the same thing happens if you revert back to PrimeNG version 4.3.0 it works. But I don't think this is the solution to manually downgrade the versions. I think they need to fix the package module or else what is the purpose of the new PrimeNG 5 release. |
After an update to Angular 5, all |
update your angular CLI |
Same here. From what I understand this is related to a version upgrade in the Angular AOT compiler which creates those *.metadata.json files. So we all have to upgrade to Angular 5, right? Otherwise primeng version 5 won't work, correct. |
Yes, PrimeNG 5 does not work with Angular 4 due to metadata.json files. You need Angular 5 to use PrimeNG 5. On the other hand, PrimeNG 4.x is for Angular 4. |
I have updated the project I use PrimeNG in to use Angular 5. However, not entirely without pain due to a regression in Angular 5 which breaks AOT for our project. You might want to consider releasing updates to PrimeNG version 4 with bug fixes for another one or two months. |
Much fun here. Updates dependencies to the latest version of Angular 4. This caused a few build issues: One is that climate-change-components specifies versions of Angular to use while building. If the Angular versions here don't match that, we get build issues that look like: "Error encountered resolving symbol values statically. Calling function 'InjectionToken', function calls are not supported." To address this it is possible to force our project's typescript compiler to always use the versions of certain packages via the "files" config of tsconfig.json. This gives us a little flexibility in which Angular version gets used in the parent project. We still should respect the Angular version requirements of the components lib, but that restriction is far more lax than the specific Angular version the components lib is built with. Another build issue was caused by ng2nouislider being updated to 1.7.5 based on the ^1.6.2 restriction in package.json. 1.7.5. is built with a version of Angular CLI designed for use with Angular 5. This led to the error: "ERROR in Error: Metadata version mismatch for module /opt/planit/angular/planit/node_modules/ng2-nouislider/src/nouislider.d.ts, found version 4, expected 3, resolving symbol SharedModule in /opt/planit/angular/planit/src/app/shared/shared.module.ts, resolving symbol SharedModule in /opt/planit/angular/planit/src/app/shared/shared.module.ts" A GitHub issue on a different project with the same issue provided enough info to pinpoint the solution, which was to use a version of ng2nouislider built with Angular CLI compatible with Angular 4. primefaces/primeng#4401
Commenting & Saving App.module.ts And again Un-commenting & Save, saved the time. Thanks. |
I got this issue and was not using PrimeNG. @vv3k sugestion worked for me |
For some weird reason @vv3k suggestion works. Thank you! |
We just ran into this as we upgraded to Primeng 5.2.3 while still on Angular 4.2 in order to get some newer functionality with p-dropdown. Where does Primeng list what versions of Angular their releases work with? The NPM page doesn't mention version dependencies with Angular. |
I am using angular 4.4.6 and must continue to use it and I am using primeng v5.2.4 'cause I like what it offers. I am running into the same error - Metadata version mismatch for module. |
ERROR in Error: Metadata version mismatch for module D:/dempApp/node_modules/primen
g/components/common/api.d.ts, found version 4, expected 3, resolving symbol AppM
odule in D:/dempApp/src/app/app.module.ts, resolving symbol AppModule in D:/dempApp/sr
c/app/app.module.ts
And my package.json
{
"name": "dempApp",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"primeng": "^5.0.0-rc.0",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.4.9",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.3.3"
}
}
The text was updated successfully, but these errors were encountered: