Cant perform ng build --prod with service workers, compiling saying it cant find the file ngsw-config.json
See original GitHub issue🐞 bug report
Affected Package
RC4
Is this a regression?
Yes (well i think so)
Description
Compiler things that ngsw-config.json is missing but its current and valid
macos:api carlfearby$ ng build --prod
Generating ES5 bundles for differential loading...
ES5 bundle generation complete.
chunk {15} polyfills-es2015.e36cdc60790d45df5654.js (polyfills) 35.9 kB [initial] [rendered]
chunk {16} polyfills-es5.7546a62f1d16f97d6209.js (polyfills-es5) 125 kB [initial] [rendered]
chunk {0} runtime-es2015.ab78985ffb7d8d43dd82.js (runtime) 2.53 kB [entry] [rendered]
chunk {0} runtime-es5.ab78985ffb7d8d43dd82.js (runtime) 2.53 kB [entry] [rendered]
chunk {1} 1-es2015.81334fc3ecae6a479384.js () 1.28 kB [rendered]
chunk {1} 1-es5.81334fc3ecae6a479384.js () 1.28 kB [rendered]
chunk {2} 2-es2015.c95adc4be43c1d058024.js () 1.42 kB [rendered]
chunk {2} 2-es5.c95adc4be43c1d058024.js () 1.42 kB [rendered]
chunk {3} 3-es2015.9bac6a17612988d60954.js () 1.27 kB [rendered]
chunk {3} 3-es5.9bac6a17612988d60954.js () 1.27 kB [rendered]
chunk {4} 4-es2015.065a029c8818ada788e8.js () 1.43 kB [rendered]
chunk {4} 4-es5.065a029c8818ada788e8.js () 1.43 kB [rendered]
chunk {5} 5-es2015.ef3f3e895e132488c5b1.js () 1.45 kB [rendered]
chunk {5} 5-es5.ef3f3e895e132488c5b1.js () 1.44 kB [rendered]
chunk {6} 6-es2015.2c873137a5b44100ce80.js () 1.47 kB [rendered]
chunk {6} 6-es5.2c873137a5b44100ce80.js () 1.46 kB [rendered]
chunk {7} 7-es2015.b5ae8601644fe456d6f0.js () 1.42 kB [rendered]
chunk {7} 7-es5.b5ae8601644fe456d6f0.js () 1.42 kB [rendered]
chunk {8} 8-es2015.bfd43f2a89a3f19078c9.js () 1.29 kB [rendered]
chunk {8} 8-es5.bfd43f2a89a3f19078c9.js () 1.29 kB [rendered]
chunk {9} 9-es2015.458f1ed4ed0eae471911.js () 1.29 kB [rendered]
chunk {9} 9-es5.458f1ed4ed0eae471911.js () 1.28 kB [rendered]
chunk {10} 10-es2015.af4288487cd00a7ece3e.js () 1.43 kB [rendered]
chunk {10} 10-es5.af4288487cd00a7ece3e.js () 1.43 kB [rendered]
chunk {11} 11-es2015.02eba41db3dee8a71930.js () 4.19 kB [rendered]
chunk {11} 11-es5.02eba41db3dee8a71930.js () 4.19 kB [rendered]
chunk {12} 12-es2015.9f0989b48eb7e7d2960a.js () 1.34 kB [rendered]
chunk {12} 12-es5.9f0989b48eb7e7d2960a.js () 1.34 kB [rendered]
chunk {13} 13-es2015.1a9f3f2e9377c1aba680.js () 1.67 kB [rendered]
chunk {13} 13-es5.1a9f3f2e9377c1aba680.js () 1.67 kB [rendered]
chunk {14} main-es2015.cd2c53cb096e2a6f13e6.js (main) 484 kB [initial] [rendered]
chunk {14} main-es5.cd2c53cb096e2a6f13e6.js (main) 555 kB [initial] [rendered]
chunk {17} styles.f7e0e5b2307e0703267a.css (styles) 11.2 kB [initial] [rendered]
chunk {scripts} scripts.14dd29b7ed0b1c01f172.js (scripts) 131 bytes [entry] [rendered]
Date: 2019-12-04T12:02:25.122Z - Hash: 40c18544d4d08469ff79 - Time: 24904ms
Error: Expected to find an ngsw-config.json configuration file in the /Users/carlfearby/Dropbox (Personal)/Angular Projects/Framework folder. Either provide one or disable Service Worker in your angular.json configuration file.
macos:api carlfearby$ cat /Users/carlfearby/Dropbox\ \(Personal\)/Angular\ Projects/Framework/ngsw-config.json
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
🔥 Exception or Error
Error: Expected to find an ngsw-config.json configuration file in the /Users/carlfearby/Dropbox (Personal)/Angular Projects/Framework folder. Either provide one or disable Service Worker in your angular.json configuration file.
🌍 Your Environment
Angular Version:
Angular CLI: 9.0.0-rc.4
Node: 12.2.0
OS: darwin x64
Angular: 9.0.0-rc.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.4
@angular-devkit/build-angular 0.900.0-rc.4
@angular-devkit/build-optimizer 0.900.0-rc.4
@angular-devkit/build-webpack 0.900.0-rc.4
@angular-devkit/core 9.0.0-rc.4
@angular-devkit/schematics 9.0.0-rc.4
@angular/cdk 8.2.3
@angular/pwa 0.803.19
@ngtools/webpack 9.0.0-rc.4
@schematics/angular 9.0.0-rc.4
@schematics/update 0.900.0-rc.4
rxjs 6.5.3
typescript 3.6.4
webpack 4.41.2
Anything else relevant? Builds were working fine before update to RC4
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
After Angular 6 update, ng build --prod yields "Error: Expected ...
First disable Service Worker in your angular.json/angular-cli.json configuration file. Then run ng build --prod on your terminal.
Read more >Service worker configuration - Angular
Service Worker in Production. The ngsw-config.json configuration file specifies which files and data URLs the Angular service worker should cache and how it ......
Read more >Service Workers & Angular - Martin Džejky Jakubik
Everything I know about Service Workers in Angular applications and how to use them. ... The service worker is configured using the ngsw-config.json...
Read more >Getting started with service workers - Angular
Creates the service worker configuration file called ngsw-config.json , which specifies the caching behaviors and other settings. Now, build the project:.
Read more >It's time to say thank you to the Angular CLI Team! | juri.dev
Nowadays, you can create, and run a new Angular project in minutes (!! ). It really just depends how fast your internet is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is not an Issue with Angular
If i change the project path to
/Users/carlfearby/Dropbox/Angular Projects/Frameworkinstead of
/Users/carlfearby/Dropbox (Personal)/Angular Projects/FrameworkIt seems to be some weird quirk with the way drop box has aliased the directory, as i have two dropboxes on my machine here at work for personal and corporate… I will close this issue now
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.