-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
critical css files are generated but are all blank. Craft and Vite setup #21
Comments
Lacking any additional information, there isn't much advice I have to offer unfortunately. I can say that this works: https://github.com/nystudio107/devmode/tree/develop/buildchain |
@khalwat just running into a project that is the same, critical files do get generated, site url is available, but when generating CriticalCSS ending up with empty CSS files. Everything seems to run, the critical config is okay according to the docs:
The files get generated but end up empty without any CSS involved. The buildchain itself doesn't throw any errors either:
|
Not sure what to say... I just deleted the critical CSS files locally for the devmode.fm site: https://github.com/nystudio107/devmode ...ran a
...and then I looked at the Critical CSS that was generated, and none of them were empty. Here's html{image-rendering:auto;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;text-rendering:optimizelegibility;box-sizing:border-box;-webkit-appearance:none;appearance:none}.devmode-container{background-color:#22223a}.devmode-background{background-image:url(https://dnzwsrj1eic0g.cloudfront.net/site/devmode-fm-dark-bg.svg)}@media (prefers-color-scheme:dark){.devmode-container{background-color:#22223a}.devmode-background{background-image:url(https://dnzwsrj1eic0g.cloudfront.net/site/devmode-fm-dark-bg.svg)}}.navbar-link{color:#eb5286;margin:calc(var(--spacing)*1);padding-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1);font-family:var(--font-sans);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));text-decoration-line:none}.title-link{color:var(--color-devmode-pink);text-decoration-line:none}.tags-link{margin-inline:calc(var(--spacing)*1);margin-block:calc(var(--spacing)*2);background-color:var(--color-devmode-yellow);padding-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:var(--leading-loose);line-height:var(--leading-loose);--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-devmode-pink);margin-left:1px;margin-right:1px;font-style:italic;text-decoration-line:none}.hamburger-menu{vertical-align:middle;font-family:var(--font-mono);font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-devmode-pink);font-style:italic}:root{--outline-color:#5db7a5,}.fonts-loaded .font-mono{font-family:Operator Mono,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.fonts-loaded [class^=icon-]:before{font-family:fontello}[class^=icon-]:before{speak:never;-webkit-text-decoration:inherit;text-decoration:inherit;text-align:center;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:1em;margin-left:.2em;margin-right:.2em;font-style:normal;font-weight:400;line-height:1em;display:inline-block}.header-background{background-size:600px}.icon-twitter:before{content:""}.icon-facebook:before{content:""}.icon-youtube-play:before{content:""}.icon-help-circled:before{content:""}.icon-info-circled:before{content:""}.icon-play:before{content:""}.icon-google-play:before{content:""}.icon-itunes:before{content:""}.icon-rss:before{content:""}.icon-menu:before{content:""}.menuBlock{display:block!important} |
@michtio are you using DDEV or Docker like Andrew? Im on DDEV |
@john-henry on DDEV. But it's weird, some projects don't generate, while others do. I've tried it on Vite 5 / Vite 6 - both have an issue on one and the same project. To me the "generation" time is really short, way too short than it should be, yet no errors thrown or nothing to be found in the logs, for sake of testing even tried to scrape "google.com" to no avail. |
@michtio, would you like to meet online to sort this out and compare builds? |
@john-henry definitely something that we can arrange, preferably next week Monday or Tuesday. You can reach out to me through Discord via @michtio |
Question
Running
npm run build
, all my criticalcss files are generated but are blank. This happens locally and on the live server.I've crossed referenced all your examples and I can't for the life of me see anything I am doing incorrectly.
I'm hoping you can help me figure this one out. I bet its something simple
Additional context
Craft 5, Craft Vite plugin, TW 4
I use
{{ craft.vite.script('src/js/app.js') }}
in my layout templatevite.config.js
The text was updated successfully, but these errors were encountered: