-
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
Error when adding new file with watcher #40
Comments
+1 |
I'm starting to experience this after upgrading to babel-loader from an older 6to5-loader. |
Aaaaand I figured it out. If you have webpackServer.quiet flag switched to |
+1 |
2 similar comments
+1 |
+1 |
I think the reason why sometimes this error is happened when you have a problem with webpack compilation every time u see it in log. Solution to catch this error and show people something like this "Hey man you have a problem with webpack comipilation fix it otherwise bla bla , run webpack compile without karma" because this error message not informative IMHO. |
You mean pull request?
|
+1 |
2 similar comments
+1 |
+1 |
If there was a compilation error the message would be swallowed by the file not found error, this commit exposes this error. codymikol#40
I ran into this, but I wasn't getting any webpack/compile errors. I fixed it by changing the webpack config in my karma.config to:
instead of
I'm getting other errors now, but that seems to have fixed this problem by getting out of the karma_webpack directory. |
@sethlivingston I don't think doing that is going to run webpack on your files... |
+1 |
@sokra: I took a look under the hood and it seems like it's a pretty straightforward issue. Let me know if you'd like any alterations to the PR. |
For me at least, this issue was caused by flycheck (in Emacs) creating temporary files. Excluding these in my karma.conf.js with |
Added a try/catch clause to guard against a "Path doesn't exist" error coming from `MemoryFileSystem.prototype.readFileSync` when a new file is added to the file-system that matches the files glob. Unfortunately, there is not a custom type on the error, so we have to resort to string magic to determine if that's the reason for the error. Closes codymikol#40
+1 |
1 similar comment
+1 |
@sokra This is still actual. Fix, suggested by the guys above, is helping. |
I don't understand what the fix is. I'm running webpack with ts-loader and the issue is easily reproducible if I simply copy an existing file into a new file that picked up by my file pattern. E.g. copying app.spec.ts to app.copy.spec.ts gives me:
@s0ber what does contexts mean in this case? |
@beakdoctor Instead of specifying file patterns inside karma configuration, you can specify just one file (a single entry point). And inside this file you can specify a webpack context, which will match files that you want. You can take a look at example here: |
Thank you. That works for me. |
Hi guys :) Until then, {
"scripts": {
"test": "nodemon --exitcrash -w karma.conf.js karma.js",
"posttest": "npm run test"
}
} karma.js: const path = require('path')
const KarmaServer = require('karma').Server
const karmaServer = new KarmaServer({ configFile: path.join(__dirname, 'karma.conf.js') }, process.exit)
karmaServer.start() npm will restart nodemon automatically when it crashes due to a new file added, and nodemon will restart karma automatically when its configuration changes |
I have karma running with watcher enabled.
It throws an error when I create new file (Product-view.jsx is new file itself)
Attaching my karma.conf.js also:
The text was updated successfully, but these errors were encountered: