Skip to content

Service worker missing config error has confusing path #8490

Closed
@StephenFluin

Description

@StephenFluin

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Versions

Node: 8.4.0
OS: linux x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

@angular/cli: 1.6.0-beta.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0-beta.0
@schematics/angular: 0.1.2
typescript: 2.4.2
webpack: 3.8.1

Repro steps.

ng new <x>
cd x
add ServiceWorkerModule and register a SW
ng build -prod

Error thrown

Error: Expected to find an ngsw-config.json configuration file in the
                                application root. Either provide one or disable Service Worker
                                build support in angular-cli.json.

Desired functionality.

Show the user WHERE they need to create the file (application root sounds like /src/app). Also would be nice to have cleaner whitespace usage.

Error: Expected to find an ngsw-config.json configuration file in the /src folder. Either provide one or disable Service Worker in .angular-cli.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions