Jump to content

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


Recommended Posts

Posted

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.

  • 2 weeks later...
Posted

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!

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
  • Recently Browsing   0 members

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