Jump to content

Parsing SCSS files throws an exception (method "compileRF" missing?)


Stefanowitsch
 Share

Recommended Posts

Hi @bernhard

I have an older project where I am using SCSS instead of LESS files.

I want to make use of the SCSS parser function of RockFrontend.

1. I installed the SCSS module
2. I added this code to my ready.php:

/** @var Scss $scss */
$scss = $modules->get('Scss');

$watchFiles = $files->find(
    $config->paths->templates . "styles/css",
    ['extensions' => 'scss']
);

// compile input SCSS to output CSS
$scss->compileIfChanged(
    input: $config->paths->templates . "styles/styles.scss",
    watch: $watchFiles,
    
);

3. My stylesheet is included like this:

<? $rockfrontend->styles()
  ->add($config->urls->templates . 'styles/styles.scss')
  ->minify(!$config->debug);
?>

When opening the website in my browser I get this exception:

ProcessWire\WireException

Method Scss::compileRF does not exist or is not callable in this context

By looking in the StylesArray.php in the RockFrontend module folder, line 293 I can see that this method is called here:

$compiler->compileRF($asset->basename, $cssFile, $cssPath, $asset->dir, $style, $sourcemap);

But the Method "compileRF" does not exist anywhere inside the RockFrontend folder.

Link to comment
Share on other sites

Hey @Stefanowitsch I'm not using SCSS in any project so I don't have a quick answer and I'd appreciate if you could debug this on your own and let me know if anything has to be changed in the module to make it work.

The SCSS support has been added by a PR: https://github.com/baumrock/RockFrontend/pull/29

Maybe you can ping the author about the problem?

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Ok this is solved now. I totally missed the corresponding PR to the SCSS module. It's now there in the dev branch and will be merged to main begin of October. Please mark this topic [solved] thx!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...