karma-webpack: ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory'
When using 1.4.0 I get the error above, <1.4.0 works great. complaint is ./spec/index.js, I assume files is the culprit, not preprocessors:
files: [
'./spec/index.js'
],
or
preprocessors: {
'./spec/index.js': ['webpack']
},
Coincidentally, I see the new webpack-karma reporter is spec, however I can’t imagine that causing a clash.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 33 (4 by maintainers)
@Keats post on Stackoverflow has a good solution.
set the extensions property on Webpack resolve configuration like this:
webpackConfig.resolve.extensions = [‘’, ‘.js’, ‘.coffee’] //ts, or anything else
That solved it for me.
I think Webpack’s error are really unfriendly… I tried for half an hour but failed to found out what’s wrong when it gives this error.
My problem was not changing the
resolve.extensionsoption to include.jsxfiles. I’ve added it to the end of mywebpack.config.jsfile and it worked:HOLY S#!T the issue for me was that I had an extra comma in my
package.jsonfile. Why is THAT hidden behind the--display-error-detailsflag?I was getting this error because my
resolve.extensionsextensions were missing dots. “jsx” should be “.jsx”, for example.@eryue0220 What is the error you’re receiving?
entryis expecting a string (or array of strings). AssumingentryFile.jsis in the same directory as yourwebpack.config.js, it should read:Yeah for me “–display-error-details” was a big help and then it turned out that some directory of mine was capitalized whereas my import scripts sources were not.
Also git was not seeing those changes locally so I ended up having to run this from my terminal to be able to commit the directory changes
git config core.ignorecase falseI have the same problem.