WebpackJsonp missing after Ionic 3 update

I recently bumped up to ionic 3 from 2. I can build my app for iOS, but ionic serve fails now with the error below.

Before I could build for iOS, I had to manually replace main.prod.ts and main.dev.ts with main.ts

Would you need any more info to be able to help?

Runtime Error
webpackJsonp is not defined

ReferenceError: webpackJsonp is not defined
    at http://localhost:8100/build/main.js:1:1
Ionic Framework: 2.0.0-rc.3
Ionic Native: 2.2.3
Ionic App Scripts: 2.0.2
Angular Core: 2.1.1
Angular Compiler CLI: 2.1.1
Node: 6.9.2
OS Platform: macOS Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
TypeError: ctx.sourceFile.getLineEndOfPosition is not a function
    at isEntireLine (/Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:217:32)
    at removeAll (/Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:209:17)
    at /Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:164:13
    at /Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:285:23
    at visitEachNode (/Users/me/Documents/Typescript/app/node_modules/typescript/lib/typescript.js:8338:30)
    at Object.forEachChild (/Users/me/Documents/Typescript/app/node_modules/typescript/lib/typescript.js:8498:24)
    at forEachImport (/Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:283:15)
    at addImportSpecifierFailures (/Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:139:5)
    at walk (/Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:130:9)
    at /Users/me/Documents/Typescript/app/node_modules/tslint/lib/rules/noUnusedVariableRule.js:38:75

Did you follow the breaking changes in the app-scripts changelog for 2.x?

That doesn’t sound right, either.

I see the same issue with my installation after updating to 3.6.0 (info below).
I’ll revert to 3.5.3 for now i guess.

@Sujan12, @elduderino15,
Replacing main.prod.ts and main.dev.ts with main.ts is a change that was required some time ago already (I believe it was when Ionic came out of RC state).

$ ionic info

cli packages:

    @ionic/cli-plugin-cordova       : 1.5.0 (/Users/Steven/Documents/AanZee/trimbos_interventies/interventie_minderdrinken/node_modules/@ionic/cli-plugin-cordova)
    @ionic/cli-plugin-ionic-angular : 1.4.0 (/Users/Steven/Documents/AanZee/trimbos_interventies/interventie_minderdrinken/node_modules/@ionic/cli-plugin-ionic-angular)
    @ionic/cli-utils                : 1.6.0 (/Users/Steven/Documents/AanZee/trimbos_interventies/interventie_minderdrinken/node_modules/@ionic/cli-utils)
    ionic (Ionic CLI)               : 3.6.0 (/Users/Steven/Documents/AanZee/trimbos_interventies/interventie_minderdrinken/node_modules/ionic)

global packages:

    Cordova CLI : 6.5.0 

local packages:

    @ionic/app-scripts : 2.1.3
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.6.0


    Node       : v6.7.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b 
    ios-deploy : 1.9.0 
    ios-sim    : 5.0.8 
    npm        : 3.10.3 

Yeah, I’ve done that quite some time ago. As I mentioned 3.5.3 does work for me so the issue lies with the latest release.

1 Like

What is your src/index.html?

1 Like

@AaronSterling Many thanks!
I was missing <script src="build/vendor.js"></script> in index.html

I updated from 3.4.0 to 3.5.x in another project and added the vendor.js to the index.html there. Then I continued with another project and updated from 3.4.0 directly to 3.6.0 and forgot to add the vendor.js there.
I feel a bit stupid now but I’m glad the issue is resolved :stuck_out_tongue:


Same here.
As Gunnaway i’ve got the same problem.
I did this :

  • rm -rf node_modules
  • added <script src="build/vendor.js"></script> in index.html
  • npm install -g ionic@latest
  • npm install @ionic/app-scripts@latest --save-dev
  • npm install ionic-angular@latest --save
  • npm upgrade for upgrade all modules.

This worked and now everything runs well

1 Like

all above solutions not worked with me
when add vendor script and run ionic serve , ionic remove it again

please help me

You have to add it to src/index.html, not www/index.html.

Thank you for the include script. Works for me!

1 Like

A post was split to a new topic: TypeError: ctx.sourceFile.getLineEndOfPosition is not a function

2.0.0 change log helped me fix this issue, when I was upgrading

I have only this problem when running on an android device with version 4.4.4. Can anyone help my with it? (it does work on new devices)