silverstripe / silverstripe-widgets

Widgets subsystem for Silverstripe CMS
http://silverstripe.org
BSD 3-Clause "New" or "Revised" License
38 stars 55 forks source link

Fails to load compass #151

Closed SpiritLevel closed 7 years ago

SpiritLevel commented 7 years ago

In scss/_settings.scss there are two import commands for compass. I can't find compass files anywhere nor can I see them pulled in anywhere during installation. This causes an error when creating and editing blog pages (with widgets and comments enabled).

Edit: I am using SS3.6.1.

dhensby commented 7 years ago

You need to install compass locally when you install sass.

See https://github.com/BetterBrief/vagrant-skeleton/blob/master/scripts/sass.sh for what's needed

SpiritLevel commented 7 years ago

Oh, I thought there was a move away from compass...in any case, shouldn't widgets just work out of the box after being installed with composer and enabled in a yml file, without needing sass or compass ?

robbieaverill commented 7 years ago

They do- compass is for compiling the sass source into CSS (which gets used by the module)

SpiritLevel commented 7 years ago

Right, so only the css, not the sass or compass, is needed to run the module. Understood. But, after only doing a composer require on blog, widgets, and comments, and enabling them in config.yml, I get the following error when creating a new blog:

screenshot from 2017-07-02 11-27-47

I thought it might be due to having an scss file watcher active in PHPStorm but the error occurs even after turning this off.

So, I installed comments, widgets, and blog in a fresh instance of SS3.6.1 and this problem doesn't arise! Very strange. I'll re-build the site above in this fresh install and see if I can reproduce the error :\

dhensby commented 7 years ago

are you using sass in your current project? I'm not sure how or why it would be trying to build the widget module css even if you were :/

SpiritLevel commented 7 years ago

Yes, I'm using scss but not compass. Yes, weird that SS is trying to compile the scss. I'll reassemble the site and see if the problem returns...

dhensby commented 7 years ago

Are you using a "watcher" or a silverstripe-sass module that is being overly aggressive with it's css compilation (ie: it's compiling CSS in all modules rather than just your project/theme)?

SpiritLevel commented 7 years ago

I had a scss file watcher and a linter active in PHPStorm. I turned them off and still got the same error. I am only using SS3.6.1 plus blog, comments, and widgets modules. I'll try this again tomorrow. Thanks for considering this wee conundrum :)

SpiritLevel commented 7 years ago

Yup. It was the file watcher; even though I eventually disable it, it initially tries to compile everything and so outputs garbled css for the module...Thanks :)