Wednesday, 7 June 2017

Webpack encoding issue plus webpackJsonp is not defined

I've been using the same webpack build system for about a year, and now I am consistently getting the following errors, every 2-3 browser refreshes. I've never upgraded node, npm, or anything in my package.json on the server this build runs. The current build system will not succeed if there are any JS syntax errors.

Errors:

  • Invalid or unexpected token (bundle-1.js)
  • webpackJsonp is not defined (bundle-2.js)

When I inspect bundle-1.js, I see the following encoding issue, even after I set the EncodingPlugin to encode UTF-8:

enter image description here

I've read other SO posts about "webpackJsonp is not defined" and tried:

  • Loading my dependencies in the different orders
  • setting minChuncks for CommonsChunkPlugin to Infinity

I am using the following software versions:

  • node v4.6.2
  • npm v3.9.0
  • webpack 1.10.1
  • grunt webpack 1.0.11
  • webpack encoding plugin 0.2.1

Any help for why these errors are appearing at run time is appreciated.



via Mike

No comments:

Post a Comment