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

Any custom.scss gives precompile errors #6038

Closed
2 tasks done
ghost opened this issue Dec 15, 2017 · 5 comments
Closed
2 tasks done

Any custom.scss gives precompile errors #6038

ghost opened this issue Dec 15, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 15, 2017

Non-Docker installation, installed using the Production Guide on Debian 9.

When I modify ~/live/config/themes.yml to:

default: styles/custom.scss

...the assets will not precompile (see the output file below).

output-assets-precompile.txt

To make sure it uses the modified ~/live/config/themes.yml you have to do:

rm -r ~/live/tmp/*

...also when restoring ~/live/config/themes.yml to default: styles/application.scss.

Results are that I can't customize my instance anymore.


  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • This bug happens on a tagged release and not on master (If you're a user, don't worry about this).
@ghost ghost changed the title custom.scss gives precompile errors Any custom.scss gives precompile errors Dec 15, 2017
@ghost
Copy link
Author

ghost commented Dec 15, 2017

FYI: I was able to put some CSS from custom.scss at the end of mastodon/components.scss. This worked like expected, no precompile errors and displayed in the web-app. So this proves that there is something wrong with the themes code.

@ghost
Copy link
Author

ghost commented Dec 16, 2017

For other people with the same issue:

The complete workaround is to paste all content of custom.scss (without @import 'application';) at the end of application.scss. Make sure config/themes.yml is set to default: styles/application.scss

@unarist
Copy link
Contributor

unarist commented Dec 18, 2017

Maybe...you have app/javascript/packs/custom.js? The file was introduced at v1.4.1 as a loader of custom.scss, but no longer needed at v1.4.2 (#3373). While its deprecation, we had special handling for that file for a long time...until v2.1.0 (#5584).

const entryPacks = [...packPaths, ...localePackPaths].filter(path => path !== join(entryPath, 'custom.js'));

What happens if .filter(path => path !== join(entryPath, 'custom.js')) is removed?

Since we load custom.scss from two entrypoints, custom.js and default (generated from themes.yml), CommonChnkPlugin extracts those "common" styles to common.css, and Webpack omits generation of blank default.css. Therefore, Mastodon will fail to find default.css.

Removing custom.js should fix this issue, I think.

@ghost
Copy link
Author

ghost commented Dec 18, 2017

@unarist YES, this was the problem! Now it works. Thank you!

I'm wondering why this file wasn't removed from my local repo? So it is still an issue for others. Can this be fixed for the next release?

cc @Gargron

@ashfurrow
Copy link
Contributor

I just ran into this problem, too, and the suggestion from @unarist worked. After deleting the custom.js file, everything compiled fine: ashfurrow@1390a8a

If having this (previously required) file is a failure as of 2.1.0, should we update the release notes to mention removing it?

@ghost ghost closed this as completed Apr 3, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants