I'm facing an issue with ionic live reload failing to build due to the error "context.getProjectMetaData is not a function" I am just encountering this issue after installing the Firebase cloud messaging cordova plugin and npm package (for push notifications). Im unsure if this would the issue as the app build and launches without live reload. (and fcm works properly)
This is the error log im getting, anyone experienced this before?
[error] TypeError: context.getProjectMetadata is not a function
at Object.configureI18nBuild (..\node_modules\@angular-devkit\build-angular\src\utils\i18n-options.js:99:36)
at Object.generateI18nBrowserWebpackConfigFromContext (..\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:85:57)
at Object.buildBrowserWebpackConfigFromContext (..\node_modules\@angular-devkit\build-angular\src\browser\index.js:67:41)
at setup ..\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:103:63)
I started having this problem after I ran npm audit fix
because I wanted to have a project that's clean of vulnerabilities.
It seems, npm audit fix
command is rather greedy. It silently upgraded my "@angular-devkit/build-angular": "~0.803.25"
to version 0.9, thus breaking my Angular 8 app with the same context.getProjectMetadata is not a function
error.
Morale of the story - be very careful with npm audit fix
and inspect what it does to your package.json
.
I was facing this same issue when updating from angular 8 to 9, what fixed it for me was:
npm install @angular-devkit/architect@latest
npm install @angular-devkit/build-angular@latest
Found original solution at https://github.com/ionic-team/angular-toolkit/issues/215#issuecomment-612616498
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With