-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: Can't find variable: webpackJsonp #24
Comments
Can you post your configuration? |
I was also running into this when using CommonsChunkPlugin in webpack. Disabling CommonsChunkPlugin when running in karma works. |
I am having the same issue and removing CommonsChunkPlugin temporarily fixes issue. Any idea how to make this work with CommonsChunkPlugin? |
|
I have this issue too. Tried to use |
CommonsChunkPlugin is not compatible with karma-webpack. Just remove it. CommonsChunkPlugin is only an optimization, it doesn't have effect on the executation. |
for more information see: codymikol/karma-webpack#24
So, maybe somebody know how can i organize separated vendors.js and *.spec.js files? |
You can solve this problem by changing the order of your files loaded into your Karma browser. karma.conf.js files: [ |
It seems that @carbosound1 could be right. I saw a little implementation of what he says. Although it would be great If @carbosound1 share a repo with CommonsChunksPlugins working correctly with karma, so he can bring to light how to solve this issue. |
I've seen this error when using |
@carbosound1 is definitely correct. If you just look at your bundles and find the one that defines webpackJsonp, then put that first in your karma config's files, you're fine. The one passed to the CommonChunksPlugins constructor in the webpack config did the trick here. |
const devConfig = require('./webpack.dev.config');
const commonsChunkPluginIndex = devConfig.plugins.findIndex(plugin => plugin.chunkNames);
devConfig.plugins.splice(commonsChunkPluginIndex, 1);
// ...
webpack: devConfig,
// ... I had to do this because my webpack.dev.config inherits from a common one which loads the CommonsChunkPlugin. This is not pretty but it's working 😄 |
I'm also using I think the problem for me is that I can't specify the vendor bundle in the @joeyrobert How are you using |
The ability to use commons chunk will be covered in v3 and by use, I mean not having to remove it for those that don't want to run multiple webpack configs. As Tobias said above, CommonsChunk has not real effect on execution. There is an open issue for this already in the milestone & @jayrmotta has a viable work around here - #24 (comment) |
webpack chunk plugin has to be removed during test runs due to incompatibility issues. codymikol/karma-webpack#24 (comment)
webpack chunk plugin has to be removed during test runs due to incompatibility issues. codymikol/karma-webpack#24 (comment)
For these who are trying to find it in order to suscribe the issue, it is #22. |
@jayrmotta Why not use |
I did this piece of code to remove a list of plugins (only one for now, but who knows...), based on plugin.constructor.name:
|
keep on getting this error, where is webpackJsonp defined?
and i've tried with a clean test file with just this one line
and it still complains ReferenceError: Can't find variable: webpackJsonp at line 12
Im using phantomjs
The text was updated successfully, but these errors were encountered: