Closed Saboteur777 closed 3 years ago
So everything works, but you're seeing that warning?
It leads here: https://github.com/addyosmani/critical#options
Which is a little confusing to me, because we're setting it here:
https://github.com/nystudio107/rollup-plugin-critical/blob/master/src/index.ts#L57
Exactly, that's why I thought opening an issue would be useful.
As you can see, the index
and contact
criticalCSS files are generated fine (with different content inside them).
Looks like it could happen due to lack of CSS:
https://github.com/addyosmani/critical/blob/master/src/file.js#L446
If you search on BASE_WARNING
you can see 2 other places where this error is omitted, but I'm betting this is CSS-related, because we definitely are passing the path
in, and I'm not seeing this error.
Thanks for going after this, it happens here: https://github.com/addyosmani/critical/blob/master/src/file.js#L575
It happens because there is no stylesheet referenced with <link rel="stylesheet" ...>
. When I added this to the <head>
, the warning was gone.
That's pretty interesting -- I think you can ignore the warning, because the Critical plugin provides the CSS generated by Vite for Critical to use, so it shouldn't need to scrape anything from the HTML document itself.
The warning still occurs, but it's comforting to see we can ignore it, and the critical CSS is still being generated as it should.
Question
Getting the following error when running
npm run build
:My config:
web
is one of my service in my Docker-based setup.Full output:
Additional context
Did almost every changes (except for cms/templates/_boilerplate/_partials/critical-css.twig) found here: https://github.com/nystudio107/craft/commit/487ad1ff1197a22a78829c1fe6ee7bb26b7c9afe
Adding
base
option tocritical
itself or tocriticalConfig
did not help. The criticalCSS files are generated fine, though.