-
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
Karma webpack hangs on the Compiled successfully statement when wepback optimization is set #322
Comments
Can confirm same. In my case, I happen to (luckily) not use any dynamic I tried numerous other workarounds, to no avail, including:
|
Why does the webpack boiler plate code not include |
I'm also experiencing the issue with Removing that property from the webpack config gets the test suite to run, but any test that involves sinon stubs and spies fails. This didn't start happening until the upgrade to webpack 4, but it's unclear if it's related to |
Seems like webpack 4 evaluates if all modules are included in the main bundle and if they are it doesn't include For my case the only fix I could find was to leave some of the modules we split code on out of the test bundle so that |
For the optimization issue the following code worked for my karma config.
|
By a case of trial and error going through the webpack ...it seems that the culprit is However I also found that if the webpack config explicitly sets As such for me, the workaround that maintains the most prod-testing parity possible ( // karma config file
const merge = require('deepmerge');
{
// ...
webpack: merge(webpackConfig, {
// Work around webpack 4 compatibility issues:
// https://github.com/webpack-contrib/karma-webpack/issues/322
optimization: {
splitChunks: false,
runtimeChunk: false
}
})
} |
Still hangs at The last working version was |
same here, might be related stuff #345 |
This bug hit me as well... I started debugging karma for the first time ever and got into this plugin. There is something wrong in the logic, it has 2 methods in |
At first I thought this has something to do with timing ... however even if I slow down things it still fails to to read the entry file. {"code":"ENOENT","errno":34,"message":"no such file or directory","path":"/tmp/_karma_webpack_/fixtures/browser/test.no-compat.index.js"} |
I found it... the memory holds transpiled data in |
Okay here is the breaking change: It adds additional ping @Teamop @michael-ciniawsky Removing .js extension fixes this issue, but there are no test cases so I have no idea why its added there :/ Maybe nodeJS provides way to normalize filename ? |
To work around this issue you can add following to karma conf file:
|
Has anyone got a repo that reproduces this? I’m really curious as to the double extension bug. |
I'ves submitted a PR (#347) that fixes the issues with |
still get error |
I had a similar issue. My webpack output file config was:
It's solve the issue, if I change that to:
|
Since the underlying issue (codymikol/karma-webpack#322) is now fixed in the latest RC of karma-webpack.
Has anyone been able to get this to work? This specific bug prevents me from upgrading to webpack@4. I have the same issue as @wosephjeber in that tests will run but any test that has a Sinon stub/spy will fail with the following:
|
I'm submitting a bug report
Webpack version:
4.0.1
Webpack Karma version:
4.0.0
Karma version:
2.0.0
Please tell us about your environment:
OSX High Sierra
Browser:
PhantomJS 2.1.7
Current behavior:
When setting the
optimization
property on the webpack config the karma webpack hangs on the statement Compiled successfully .When removing the optimization property it runs the tests but fails on tests that try to use dynamically imported chunks on:
undefined is not a constructor (evaluating '__webpack_require__.e
Expected/desired behavior:
Not sure
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.
N\A
What is the expected behavior?
Not sure
What is the motivation / use case for changing the behavior?
Not Sure
The text was updated successfully, but these errors were encountered: