We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am unable to build an Angular 17 Project after adding @angular/pwa followed by @angular-architects/module-federation.
@angular/pwa
@angular-architects/module-federation
Running ng build after adding @angular-architects/module-federation results in the below error:
ng build
Error: Schema validation failed with the following errors: Data path "/serviceWorker" must be boolean.
Error seems to be a result of the serviceWorker field in angular.json now accepting string values.
serviceWorker
angular.json
string
angular.json (Angular 16)
"serviceWorker": true, "ngswConfigPath": "ngsw-config.json"
angular.json (Angular 17)
"serviceWorker": "ngsw-config.json",
Set the serviceWorker value in angular.json back to how it was in Angular 16 PWA:
ng new Angular17Project ng add @angular/pwa ng build ng add @angular-architects/module-federation ng build
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "Angular17Project": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "ngx-build-plus:browser", "options": { "outputPath": "dist/angular17-project", "index": "src/index.html", "polyfills": [ "zone.js" ], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", "src/assets", "src/manifest.webmanifest" ], "styles": [ "src/styles.scss" ], "scripts": [], "main": "src/main.ts", "extraWebpackConfig": "webpack.config.js", "commonChunk": false }, "configurations": { "production": { "budgets": [ { "type": "initial", "maximumWarning": "500kb", "maximumError": "1mb" }, { "type": "anyComponentStyle", "maximumWarning": "2kb", "maximumError": "4kb" } ], "outputHashing": "all", "serviceWorker": "ngsw-config.json", "extraWebpackConfig": "webpack.prod.config.js" }, "development": { "optimization": false, "extractLicenses": false, "sourceMap": true } }, "defaultConfiguration": "production" }, "serve": { "builder": "ngx-build-plus:dev-server", "configurations": { "production": { "buildTarget": "Angular17Project:build:production", "extraWebpackConfig": "webpack.prod.config.js" }, "development": { "buildTarget": "Angular17Project:build:development" } }, "defaultConfiguration": "development", "options": { "port": 4201, "publicHost": "http://localhost:4201", "extraWebpackConfig": "webpack.config.js" } }, "extract-i18n": { "builder": "ngx-build-plus:extract-i18n", "options": { "buildTarget": "Angular17Project:build", "extraWebpackConfig": "webpack.config.js" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "polyfills": [ "zone.js", "zone.js/testing" ], "tsConfig": "tsconfig.spec.json", "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", "src/assets", "src/manifest.webmanifest" ], "styles": [ "src/styles.scss" ], "scripts": [] } } } } } }
Should build successfully.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I am unable to build an Angular 17 Project after adding
@angular/pwa
followed by@angular-architects/module-federation
.Running
ng build
after adding@angular-architects/module-federation
results in the below error:Error: Schema validation failed with the following errors: Data path "/serviceWorker" must be boolean.
Error seems to be a result of the
serviceWorker
field inangular.json
now acceptingstring
values.angular.json (Angular 16)
angular.json (Angular 17)
Workaround
Set the
serviceWorker
value inangular.json
back to how it was in Angular 16 PWA:How to Reproduce
angular.json (Angular 17)
Expected Behaviour
Should build successfully.
The text was updated successfully, but these errors were encountered: