Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with non minified CSS files #53

Closed
manikantag opened this issue Dec 31, 2016 · 9 comments
Closed

Problem with non minified CSS files #53

manikantag opened this issue Dec 31, 2016 · 9 comments
Labels
blocked/upstream Issues blocked by upstream bugs

Comments

@manikantag
Copy link

manikantag commented Dec 31, 2016

I m not sure if this is really a electron-forge issue, as I doubt this is an issue with electron-compile itself. But anyway I wanted to confirm.

Please describe your issue:
Non minified CSS files not being loaded properly after package/make. Same are working fine with electron-forge start. And if I use minified CSS files, they are working with package/make too.

Please see this repo to reproduce the issue: https://github.com/manikantag/electron-compile-css-issue

electron-forge start --> will start the app and text will be blinking.
electron-forge package --> open the electron-forge-demo\out\electron-forge-demo-win32-x64\electron-forge-demo.exe file. App will be opened, but text will not be bliking and in the devtools network tab you can something similar to below one.

Use the min.css (https://github.com/manikantag/electron-compile-css-issue/blob/master/src/index.html#L7) and run the electron-forge package and this time text blinks (-> CSS file loaded correctly).

image

@manikantag
Copy link
Author

@MarshallOfSound I feel this is similar to the issue I've reported here electron-userland/electron-compile#61 (comment)

@malept malept added the blocked/upstream Issues blocked by upstream bugs label Dec 31, 2016
@malept
Copy link
Member

malept commented Dec 31, 2016

If you look at the error you get in the devtools pane, it's clear that the error is caused by electron-compile. Here's the error in full, when I run it:

Failed to compile /tmp/electron-compile-css-issue/out/electron-forge-demo-linux-x64/resources/app/src/css/app.css: Cannot read property 'get' of null
TypeError: Cannot read property 'get' of null
    at /tmp/electron-compile-css-issue/out/electron-forge-demo-linux-x64/resources/app/node_modules/electron-compile/lib/compiler-host.js:282:34
    at next (<anonymous>)
    at step (/tmp/electron-compile-css-issue/out/electron-forge-demo-linux-x64/resources/app/node_modules/electron-compile/lib/compiler-host.js:41:191)
    at /tmp/electron-compile-css-issue/out/electron-forge-demo-linux-x64/resources/app/node_modules/electron-compile/lib/compiler-host.js:41:361

My guess as to what is happening is that it's failing to find both a CSS compiler and a fallback for the text/css file. It might be ignoring the app.min.css one because there are two dots in it and not one (and so it can't even find a sufficient mime type for it), but that last part is complete speculation.

@manikantag
Copy link
Author

@malept Weird thing is just having .min.css (tow dots in the file name) is also not working. Try renaming the app.css to app.min.css (without actually minifying the contents). Same error will be thrown.

@malept
Copy link
Member

malept commented Dec 31, 2016

I did mention that the last part of my statement was complete speculation 😃

I still think that this isn't specifically an Electron Forge issue, but I'll defer to one of the other maintainers with more experience with electron-compile.

@MarshallOfSound
Copy link
Member

MarshallOfSound commented Dec 31, 2016

@manikantag Where is app.css in your project structure?

@MarshallOfSound
Copy link
Member

@manikantag This issue has been fixed in this PR

electron-userland/electron-compile#163

@manikantag
Copy link
Author

@anaisbetts
Copy link
Contributor

This is fixed in electron-compile v5.1.2, my apologies for the bug and thanks for the great repro app @manikantag

@manikantag
Copy link
Author

@paulcbetts that is a very generous reply 👍

I've updated to 5.1.2, and is working fine with non-min css too. Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/upstream Issues blocked by upstream bugs
Projects
None yet
Development

No branches or pull requests

4 participants