Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Adding CSS Loaders

npm start - Module not found, cannot resolve style.css

Hi, i was following the videos just fine until i got stuck here. This is the error shown by the web server:

ERROR in ./app.js Module not found: Error: Can't resolve '/css/style.css' in 'C:\mamp\htdocs\project' @ ./app.js 11:0-2

Please help

Can you post the code for style.css and app.js? Specifically line 11 in app.js

1 Answer

Did you make sure to install the needed npm modules, style-loader and css-loader?

npm install --save-dev style-loader css-loader

Also, double check your webpack.config.js file to make sure it matches the instruction, specifically lines 18-19.