electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

Error when adding and importing a css file in the react template #253

Closed abdallahz3 closed 7 years ago

abdallahz3 commented 7 years ago

an error occurs when adding a css file and importing it in a react component, and the error is "null code returned for "C:\Users\User\projects\project\src\components\App\App.css". Please raise an issue on 'electron-compile' with the contents of this file."

the error occurs even if the css file is empty and importing(i.e. just importing it)

MarshallOfSound commented 7 years ago

How are you importing the file? Are you using less / scss or are you trying to import a css file into JS.

Importing CSS into a JS file is not supported, it is a webpack concept that does not translate into Electron development.

abdallahz3 commented 7 years ago

you are right, I am importing the css file directly, I did not know that. thanks

MarshallOfSound commented 7 years ago

If you want to use CSS / LESS / SCSS you should use link tags like normal HTML

<link href="./path/to/file.less" rel="stylesheet" />