Scully: '/styles.css' is not found when rendering with Critical CSS plugin

Created on 26 Sep 2020  路  4Comments  路  Source: scullyio/scully

馃悶 Bug report

Description

File not found error is shown when running Scully with @scullyio/scully-plugin-critical-css.

Error: File not found: /my-app/dist/static/styles.css

I guess following line in the plugin should have been commented out.

const { html } = await critical.generate({
  html: incomingHtml,
  base,
  css: join(scullyConfig.outDir, '/styles.css'),  // should be commented out?

馃敩 Minimal Reproduction

Add criticalCSS then run Scully.

import { ScullyConfig, setPluginConfig } from '@scullyio/scully';
import { criticalCSS } from '@scullyio/scully-plugin-critical-css';
const defaultPostRenderers = ['seoHrefOptimise', criticalCSS];
export const config: ScullyConfig = {
  ...,
  defaultPostRenderers,
};

馃捇Your Environment

Angular Version:

Angular CLI: 10.1.3
Node: 12.16.3
OS: darwin x64

Angular: 10.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1001.3
@angular-devkit/build-angular   0.1001.3
@angular-devkit/core            10.1.3
@angular-devkit/schematics      10.1.3
@angular/cdk                    10.2.2
@angular/material               10.2.2
@schematics/angular             10.1.3
@schematics/update              0.1001.3
rxjs                            6.6.3
typescript                      4.0.3

Scully Version:

"@scullyio/ng-lib": "~1.0.0",
"@scullyio/scully": "~1.0.0",
"@scullyio/scully-plugin-critical-css": "0.0.1",

馃敟 Exception or Error

route: "/posts/2020-06-05-scully" could not inline CSS Error: Error: File not found: /Users/puku0x/Desktop/website/dist/static/styles.css
       Current working directory: /Users/puku0x/Desktop/website
       Searched in: /Users/puku0x/Desktop/website/dist/static/posts/2020-06-05-scully, /Users/puku0x/Desktop/website/dist/static, /Users/puku0x/Desktop/website/dist/static/assets, /Users/puku0x/Desktop/website, /
Route "/posts/2020-06-05-scully" rendered into file: "./dist/static/posts/2020-06-05-scully/index.html"
bug

All 4 comments

@puku0x Can you provide a repo that shows the issue. In our test, we are not seeing this issue.
The plugin is still inn beta, and the start css file isn't configurable yet. this will change shortly. But the tool needs to know the 'starting' css file(s)

@SanderElias Thank you for your reply.

This is the repo for the reproduction.
https://github.com/puku0x/scully-issue-967

I just pushed v0.0.2 to NPM. Perhaps you can give that a spin.
The configuration options are also in there. When the PR is merged, the updated docs will also be available

Confirmed that the error has gone

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valonymeri picture valonymeri  路  5Comments

jorgeucano picture jorgeucano  路  4Comments

skatcat31 picture skatcat31  路  3Comments

Gyrosh picture Gyrosh  路  5Comments

jorgeucano picture jorgeucano  路  4Comments