Relative CSS File import issue #1455

Closed
opened 2025-08-09 17:20:12 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @seamc on 8/4/2016

I'm getting an issue using css-loader in conjunction with this (wonderful) project. Inclusion of a relative css file via import or require throws the following webpack compilation error via ASP.NET:

ERROR in ./ReactApp/components/ReactApp.css Module build failed: Error: Cannot find module './../../node_modules/css-loader/lib/css-base.js' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at eval (eval at <anonymous> (D:\Code\JavaScriptServices\samples\react\ReactGrid\node_modules\css-loader\index.js!D:\Code\JavaScriptServices\samples\react\ReactGrid\ReactApp\components\ReactApp.css:54:2), <anonymous>:1:18)

Running webpack by itself will correctly process the .css file.

Within the ReactGrid sample application, I added a ReactApp.css file to the components directory and tried to include it at the app's root ReactApp.jsx file: import ./ReactApp.css. HMR will recognize a new .css file but will not hot reload anything.

*Originally created by @seamc on 8/4/2016* I'm getting an issue using css-loader in conjunction with this (wonderful) project. Inclusion of a relative css file via import or require throws the following webpack compilation error via ASP.NET: `ERROR in ./ReactApp/components/ReactApp.css Module build failed: Error: Cannot find module './../../node_modules/css-loader/lib/css-base.js' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at eval (eval at <anonymous> (D:\Code\JavaScriptServices\samples\react\ReactGrid\node_modules\css-loader\index.js!D:\Code\JavaScriptServices\samples\react\ReactGrid\ReactApp\components\ReactApp.css:54:2), <anonymous>:1:18)` Running `webpack` by itself will correctly process the .css file. Within the ReactGrid sample application, I added a ReactApp.css file to the components directory and tried to include it at the app's root ReactApp.jsx file: `import ./ReactApp.css`. HMR will recognize a new .css file but will not hot reload anything.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1455
No description provided.