Uncaught ReferenceError: webpackJsonp is not defined
See original GitHub issuehi 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:
even that I added to the spec.bundle.js I got the same error
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:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In my case, in
.html
I was referencingapp.js
BEFOREvendor.js
, reversed/corrected the order, and thewebpackJsonp
error was gone.Hope this helps.
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.