question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught ReferenceError: webpackJsonp is not defined

See original GitHub issue

hi there, well, only when run the tests, this happens when I split my app into chunks by using the CommonsChunkPlugin to split vendor libraries in this case angular

here’s my webpack.config.js

var path = require('path'),
    webpack = require('webpack');

var config = {
   context: __dirname,
   devtool: 'source-map',
   entry: {
      main: [
         'babel-polyfill',
         './client/crm/crm.js',
         './client/build/vendors.js',
         './client/crm/assets/stylus/styles.styl'
      ],
      // Since angular is installed as a node module, node_modules/angular,
      // we can point to it directly, just like require('angular');
      vendors: ['angular']
   },
   output: {
      path: __dirname + '/client/build',
      //publicPath: 'http://localhost:8080/client/crm/',
      filename: 'bundle.js'
   },
   module: {
      preLoaders: [{test: /\.js$/, loader: 'jshint-loader', exclude: /node_modules/}],
      loaders: [
         {
            test: /\.js$/,
            loader: 'babel',
            exclude: [
               path.resolve(__dirname, 'node_modules')
            ],
            // Options to configure babel with
            query: {
               cacheDirectory: true,
               plugins: ['transform-runtime'],
               presets: ['es2015', 'stage-2']
            }
         },
         {test: /\.html$/, loader: 'html', exclude: /node_modules/},
         {test: /\.css$/,  loader: 'style!css', exclude: /node_modules/},
         {test: /\.styl$/, loader: 'style!css!stylus', exclude: /node_modules/},
         {test: /\.png/,   loader: 'url?limit=100000&mimetype=image/png' },
         {test: /\.jpg/,   loader: 'file-loader' },
         {test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader'},
         {test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader' }

      ]
   },
   plugins: [
      new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js')
   ]
};

if (process.env.NODE_ENV === 'production') {
   config.output.path = __dirname + '/dist';
   config.plugins.push(new webpack.optimize.UglifyJsPlugin());
   config.devtool = 'source-map';
}

module.exports = config;

and offcourse I added to my index.html

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>CRM+</title>
   <link rel="stylesheet" href="crm/assets/css/bootstrap.css">
</head>
<body class="CRM-background">

<crm></crm>

<script src="build/vendors.js"></script>
<script src="build/bundle.js"></script>

</body>
</html>

but when I run the tests, I got this:

webpackjsonp

even that I added to the spec.bundle.js I got the same error

webpackjsonp2

is there something that I missing??? I’ve searched but coudn’t find something similar to this case, hope somebody help me 😃

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

71reactions
mwmcodecommented, Jan 14, 2017

In my case, in .html I was referencing app.js BEFORE vendor.js, reversed/corrected the order, and the webpackJsonp error was gone.

Hope this helps.

5reactions
JaxonWrightcommented, Nov 16, 2017

Strangely enough, I was able to fix this by clearing my cache with ctrl+F5. This error randomly showed up after updating an HTML file with a button, but that seems unrelated as it stuck with I removed what I added.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpackJsonp is not defined - Stack Overflow
Problem. I want to load my script however I meet some ReferenceError. Uncaught ReferenceError: webpackJsonp is not defined. I am loading vendor.
Read more >
Uncaught ReferenceError: webpackJsonp is not defined #5002
After packaging, the loading page will appear this situation: Uncaught ReferenceError: webpackJsonp is not defined at vendor.0d1ec0a758.js:1 ...
Read more >
ReferenceError webpackJsonp is not defined - PI Square
Hi Guys. I've been trying to build my own PIVision symbol using the new amCharts libraries, however, I'm running into a "webpackJsonp is...
Read more >
webpackJsonp is not defined at app.js:1 - Laracasts
Uncaught ReferenceError : webpackJsonp is not defined at app.js:1. As mentioned in the title, I'm getting "not defined" errors for JQuery and webpackJsonp ......
Read more >
Uncaught Reference Error: webpackJsonp is not defined
Good afternoon, I have a problem with the password reset page, this page throws me the error of: Uncaught ReferenceError: webpackJsonp is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found