-
Notifications
You must be signed in to change notification settings - Fork 220
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
Webpack 2.2.0-rc.4 throws an error because karma-webpack passes incorrect entry option #193
Comments
I was first 😄 |
You mean #192? Perhaps it's the same issue, but there are no details what went wrong in your ticket. |
Not sure if this is relevant, but here's the config which we pass to Karma:
|
What if you pass |
I added function webpack(options, callback) {
options.entry = [];
... And I got the same error. |
A quick workaround can be to set
The tests run and pass :) |
Could you make a tiny example of this for me to reproduce and add to test cases. |
Quick work around is webpackOptions.entry = function(){return {}}; this way it works like it used to. This style was built for hot reloading stuff. |
No this is exactly how we will fix it. Thank you for posting this workaround. |
Will send a PR. Thanks @TheLarkInn |
@gyandeeps - Be mindful to open said pull request to https://github.com/webpack/karma-webpack/tree/v1 & not master. I'll land it as soon as it arrives. |
@d3viant0ne It took me a while to figure out why the index.js was empty. lol |
Already merged. @TheLarkInn will cut a patch release shortly And thank you :) |
@d3viant0ne Please merge this PR #195 as I had some lint issues in previous one. |
Already done. I'm quick with that little green button of doom :) |
Before I publish, since I can't test this via our current suite, would someone mind running this commit against their build to ensure it works. I don't have a local reproducible example of this. // @Reinmar @egoroof @gyandeeps |
@TheLarkInn I actually tested it with my karma webpack (rc4) setup. That how I figured this out. |
@TheLarkInn - Verifying it now |
Awesome thank you. Also @MikaAK You are the only one with privileges can you publish this? |
I have the tags pushed and release commits pushed. |
Besides the usual suspects, i.e. @sokra |
@TheLarkInn I saw u created a release but i am not seeing it here anymore: https://github.com/webpack/karma-webpack/releases Even its not their on npm. |
I removed the tag as it still throws the same error |
huh... it worked for me with webpack (rc4). Can you share your setup or any details. |
Note to absolutely everyone who will run into this. Most common webpack test configurations set When updating to |
ah i see. Should we just check if its an empty object ( |
I'll stick a note in the tag regarding the required change. |
I would recommend |
It's a fix for a breaking change in Webpack ( technically ) not something I would cut a major for. When using anything but rc.4 it behaves exactly as it did before as it's just failing on schema validation in Webpack. |
Sounds good. I will wait for npm to start showing me 1.8.2 |
@TheLarkInn @d3viant0ne Has this been released to npm ? |
No, limited number or people with npm access. Taking care of that now. |
- defaults webpackOptions.entry to a function BREAKING CHANGE: Remove entry:{} from test configurations When updating to `"webpack": "2.2.0-rc.4"` & `"karma-webpack": "1.8.2"` you have to pull the `entry` property if it's set to an empty object so it defaults to a function within karma-webpack
@gyandeeps - After a bit of discussion, the decision was made to make this a major after all. Proper tag is cut here - https://github.com/webpack/karma-webpack/releases/tag/v2.0.1 @TheLarkInn should be pushing that up to npm shortly. |
Resolving - https://www.npmjs.com/package/karma-webpack @ |
For anyone who stumbles upon that. I've recently migrated to Webpack 2 but my karma config stayed the same. And now when I was trying to run my tests with webpack-karma 2.0.1 I was getting :
which tells nothing at all. After some
So be sure that your webpack config is correct before anything else :) |
I have the same issue, updated here: |
i am having the same problem with webpack , i cant understand how do i resolve |
@mantupani17 Have you tried @gyandeeps solution? It worked for me. I've shortened it a bit by using arrow functions webpackConfig.entry = () => ({}); |
I'm submitting a bug report
Webpack version:
2.2.0-rc.4
Webpack Karma version:
1.8.1
Karma version:
1.3.0
Please tell us about your environment:
OSX 10.12
Current behavior:
Expected/desired behavior:
It worked fine with Webpack 2.2.0-rc.3. Webpack either hasn't been validating the
entry
option or the validation was more loose.The config which karma-webpack passes to Webpack is this:
The important part is
entry: {}
.The text was updated successfully, but these errors were encountered: