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

Generated inline styles are wrong #39

Closed
cheesytim opened this issue Jun 5, 2019 · 2 comments
Closed

Generated inline styles are wrong #39

cheesytim opened this issue Jun 5, 2019 · 2 comments

Comments

@cheesytim
Copy link

Hello! I have SPA (vue + vue cli), after build, I get styles from another page, my main page (/, -> redirect to /signin) contains only auth form, simple header, footer, logo (look at example of using styles in screenshot) and it can't pass you next page, until you Sign In
Screenshot 2019-06-05 at 13 44 25

But, my generated inline styles are from protected page (for authorized users)
How is it happen?
Puppeteer can't auth on it own, but seems it get protected page for generated styles, can I control somehow generating process for watching Pupeteer work, console?(might be getting Promise in config?).

My vue.config.js

  configureWebpack: config => {
    if (process.env.NODE_ENV === 'production') {
      config.plugins.push(
        new HtmlCriticalWebpackPlugin({
          base: path.resolve(__dirname, 'dist'),
          src: 'index.html',
          dest: 'index.html',
          inline: true,
          minify: true,
          width: 1200,
          height: 900,
          ignore: ['@font-face'],
          penthouse: {
            blockJSRequests: false
          }
        })
      );
    }
  },

Any suggestions?

@thescientist13
Copy link
Collaborator

thescientist13 commented Jun 5, 2019

Thanks for reporting this issue @Tim152

I would see some other related open issues, it's not clear how well critical itself works with SPA, since all the HTML is generated dynamically.

Can you confirm if running critical directly from the command line produces different (better / expected) results?

@cheesytim
Copy link
Author

cheesytim commented Jun 6, 2019

@thescientist13 Thank you for respond!
Unfortunately no, critical directly from command line produces exactly the same wrong result, seems like it's not plugin's fault..

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

No branches or pull requests

2 participants