Skip to content

NG6 - ngsw doesn't work offline #12329

@renydev

Description

@renydev

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Win 10
Angular CLI: 6.2.2
Node: 8.11.2
npm: 5.6.0
OS: win32 x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package Version

@angular-devkit/architect 0.8.2
@angular-devkit/build-angular 0.8.2
@angular-devkit/build-optimizer 0.8.2
@angular-devkit/build-webpack 0.8.2
@angular-devkit/core 0.8.2
@angular-devkit/schematics 0.8.2
@angular/cdk 6.4.7
@angular/cli 6.2.2
@angular/material 6.4.7
@angular/pwa 0.8.2
@ngtools/webpack 6.2.2
@schematics/angular 0.8.2
@schematics/update 0.8.2
rxjs 6.2.2
typescript 2.9.2
webpack 4.19.0

Repro steps

To reproduce this bug you can:

  • npm install -g @angular/cli@latest
  • ng new project
  • ng add @angular/material
  • ng add @angular/pwa
  • ng build --prod

I did some lazy load but I think it doesn't matter...

The log given by the failure

When I refresh the browser on offline mode, none of my files stay on cache. The service worker ngsw-worker.js get registered normally online andit seems that cache some of my *.js and *.css files, but not my main.js or index.html. And then, again, offline it caches nothing.

I would like to solve this by not creating my own sw.js, but I am new at angular and I think it is the only way for now.

onlinemode

offlinemode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions