Skip to content
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

Results Generated Unrelated to URL #16

Open
raray opened this issue Sep 12, 2023 · 11 comments
Open

Results Generated Unrelated to URL #16

raray opened this issue Sep 12, 2023 · 11 comments
Labels
question Further information is requested

Comments

@raray
Copy link

raray commented Sep 12, 2023

Question

I am highly confused about the results I am seeing. I've tried multiple different criticalUrl values. I've even used the exact example config from the docs. No matter what I put in, I get this CSS generated:

@charset "UTF-8";@import url(https://use.typekit.net/fbe6xqa.css);@font-face{font-family:AvenirNextVariable;src:url(/assets/fonts/AvenirNextVariableRoman.woff) format("woff-variations"),url(/assets/fonts/AvenirNextVariableRoman.woff2) format("woff2-variations");font-weight:400 900;font-stretch:75% 100%;font-style:normal;font-display:swap}@font-face{font-family:AvenirNextVariable;src:url(/assets/fonts/AvenirNextVariableItalic.woff) format("woff-variations"),url(/assets/fonts/AvenirNextVariableItalic.woff2) format("woff2-variations");font-weight:400 900;font-stretch:75% 100%;font-style:italic;font-display:swap}

Additional context

  • Running locally.

  • That typekit, and those type styles, are from my local project.

  • I see the following logs:

    Generating critical CSS from https://nystudio107.com/ to index_critical.min.css
    Generating critical CSS from https://nystudio107.com/about to about/index_critical.min.css
    
@raray raray added the question Further information is requested label Sep 12, 2023
@khalwat
Copy link
Contributor

khalwat commented Sep 12, 2023

Why are you generating Critical CSS from the nystudio107.com website?

@raray
Copy link
Author

raray commented Sep 12, 2023

@khalwat I am trying to get any result that makes sense. As part of that effort, I tried multiple URLs including the one shown in the example docs.

I've tried multiple different criticalUrl values. I've even used the exact example config from the docs.

@khalwat
Copy link
Contributor

khalwat commented Sep 12, 2023

The URL you should be pulling the Critical CSS from is your website's URL.

@raray
Copy link
Author

raray commented Sep 12, 2023

Yes. I know. I've tried that. I always get the result above regardless of the URL I enter.

@raray
Copy link
Author

raray commented Sep 12, 2023

The current config is this:

PluginCritical({
      criticalUrl: '[production url]',
      criticalBase: 'craft/web/assets/dist',
      criticalPages: [
        { uri: '', template: 'index' },
      ],
      criticalConfig: {
        user: '[production user]',
        pass: '[production pass]',
        strict: true,
      },
    }),

@khalwat
Copy link
Contributor

khalwat commented Sep 12, 2023

Remove the password protection from your site and try again without it in the config? I've never tried it with that in there, so I'm unsure if it will work.

@raray
Copy link
Author

raray commented Sep 12, 2023

I will try that, but I used multiple URLs that don't have passwords. Shouldn't I get a result from your website, or https://google.com which I also tried?

@khalwat
Copy link
Contributor

khalwat commented Sep 12, 2023

Other URLs will not have CSS that matches yours, so you won't get any reasonable output

@raray
Copy link
Author

raray commented Sep 12, 2023

I removed the password. No change.

I'm highly confused by your responses. Does Critical compare the scraped CSS against something else to generate its results?

@khalwat
Copy link
Contributor

khalwat commented Sep 12, 2023

yes, it pulls the CSS from your Vite project

@raray
Copy link
Author

raray commented Sep 12, 2023

I see, thanks. That was a clue. I switched everything to the staging environment which is a closer match to what I'm working with and it does seem to be trying to build something more significant. So much that it times out. I set the Penthouse timeout up to 5 minutes and it still timed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants