1

I am getting this error when trying to use CSS-Loader...

Module not found: Error: Cannot resolve module 'file'

What's going on?

1 Answer 1

1

Poorly named error. To fix,

npm install --save file-loader

Module "file" is actually file-loader but the syntax removes the word loader for some reason.

Sign up to request clarification or add additional context in comments.

2 Comments

I think that your config contains something like loaders : [ 'file', ... ], and Webpack tries both file and file-loader and gives up if it can't find any of those modules.
I have the file loader installed but I still get this error. It's also on a 'required' css file that's a slightly newer version of the one I was using previously and in a different location. All I did was change the path to the newer version of the file and now I get this error. I'm using webpack 1.13.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.