angular-cli: webpackJsonp is not defined

Bug Report or Feature Request (mark with an x)

- [x] bug report 
- [ ] feature request

Versions.

Output from: ng --version. @angular/cli: 1.4.6 node: 6.11.3 os: darwin x64 @angular/animations: 4.4.4 @angular/cdk: 2.0.0-beta.12 @angular/common: 4.4.4 @angular/compiler: 4.4.4 @angular/core: 4.4.4 @angular/forms: 4.4.4 @angular/http: 4.4.4 @angular/material: 2.0.0-beta.12 @angular/platform-browser: 4.4.4 @angular/platform-browser-dynamic: 4.4.4 @angular/router: 4.4.4 @angular/cli: 1.4.6 @angular/compiler-cli: 4.4.4 @angular/language-service: 4.4.4 @angular/service-worker: 1.0.0-beta.16 typescript: 2.3.4 macOS Sierra 10.12.6

Android Devices :

  • Samsung Galaxy S7 Edge, Android 7.0, Chrome 61.0.3163.98
  • Motorola Moto E4, Android 7.1.1, Chrome 61.0.3163.98
  • Pixel C, Android 8.0, Chrome 61.0.3163.98

Repro steps.

I have a webapp with a SW (generate by CLI), I build it with the “ng build --prod” command.

  • Open the webapp in Chrome on Android Device
  • Close Chrome
  • Repeat open (the webapp opened previously reload)/close Chrome few times, and the error happen

Important : I can’t reproduce it without a registered SW.

OR

  • Install app on Android Device
  • Repeat open/close the app few times, and the error happen

I can’t reproduce the error on my Mac.

The log given by the failure.

 Uncaught ReferenceError: webpackJsonp is not defined at sw-register.cddb6ecf3e30717910a9.bundle.js:1 

Desired functionality.

Webapp launch & display OK.

Mention any other details that might be useful.

I’ve already find this similar issue : https://github.com/angular/angular-cli/issues/4998 But my uglify version is 3.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 23 (1 by maintainers)

Most upvoted comments

I have same issue only on IE 11

Same issue here.

I had the same problem a while ago, turned out it was a problem with my browser (chrome). I cleaned the cache and then it worked great.

Closing as no reproduction was provided.

If the problem persists, please open a new issue following our submission guidelines.

A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

webpackJsonp is not defined usually mean you are not loading the javascript bundles in the right order. They must be loaded in the order present in the index.html that the CLI generates.

Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

I’m getting the same problem showing up when I put a CDN in front of express…goes away when I invalidate the cache. Any reason this would pop up with the way a CDN stores/ distributes the files?

@fabienbranchel :

Could you send me a example of your package.json file, please?

Thanks a lot.