Angular-cli: webpackJsonp is not defined

Created on 19 Sep 2016  路  5Comments  路  Source: angular/angular-cli

As soon as i include any js file in index.html, the browser console show the error "webpackJsonp is not defined"

Version information:

  • angular-cli: 1.0.0-beta.14
  • node: 6.4.0
  • os: linux x64
RFC / discussion / question

Most helpful comment

I just ran across a similar issue. I am using angular with ASP.Net. I have to include the script libraries in my main page. The included script library statements have worked fine since CLI release beta.14. However, the location of WebpackJsonp changed since release beta.14. It was moved from inline.js to inline.bundle.js.

I had to copy the script statements from the distindex.html file and place the statement in my ASP.Net Views\Shared_Layout.cshtml file. I also had to update the path for each .js file to reflect the location in my ASP.Net solution.

Hope this helps someone.

All 5 comments

You shouldn't try to add files directly to index.html because that way the bundling breaks.

I know it's a bit unintuitive but different build systems do impose some restrictions on how to import stuff.

Can you tell me what you're trying to do? Maybe I can help you do it the right way for CLI projects.

Hi. I use the same version of CLI and Node and trying to add MDL selectfield.
https://github.com/MEYVN-digital/mdl-selectfield
Adding the .js in index.html but it breaks bundle, do anyone have an idea how I should add .js file without breaking bundle?

@KingRauk see https://github.com/angular/angular-cli#3rd-party-library-installation

Closing issue as inactive.

I just ran across a similar issue. I am using angular with ASP.Net. I have to include the script libraries in my main page. The included script library statements have worked fine since CLI release beta.14. However, the location of WebpackJsonp changed since release beta.14. It was moved from inline.js to inline.bundle.js.

I had to copy the script statements from the distindex.html file and place the statement in my ASP.Net Views\Shared_Layout.cshtml file. I also had to update the path for each .js file to reflect the location in my ASP.Net solution.

Hope this helps someone.

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._

Was this page helpful?
0 / 5 - 0 ratings