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

Invalid CSS found while evaluating ${url} #410

Open
oguzhanaslan opened this issue Feb 26, 2021 · 1 comment
Open

Invalid CSS found while evaluating ${url} #410

oguzhanaslan opened this issue Feb 26, 2021 · 1 comment

Comments

@oguzhanaslan
Copy link

oguzhanaslan commented Feb 26, 2021

Hi,

I'm getting this error:
Invalid CSS found while evaluating http://myurl/#style[0]: ";html" But, the critical file is created successfully.

Why am I getting this error? Is this an important message?

Notes: I use inline css on my page, not , on my page. Because i used styled components.

`
(async () => {
const browser = await puppeteer.launch({
headless: false,
});

let result;

try {
    result = await minimalcss.minimize({
        urls: ['http://url/'],
        styletags: true,
        ignoreJSErrors: true,
        ignoreRequestErrors: true,
        ignoreCSSErrors: true,
        browser,
        viewport: {
            width: 340,
            height: 640,
            isMobile: true,
        },
        loadimages: true,
        userAgent: 'User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Mobile Safari/537.36',
        skippable: request => {
            return !!blockedResources.includes(request._url)
        },
    });

    if (!fs.existsSync(__baseOutput)) {
        fs.mkdirSync(__baseOutput);
    }

    fs.writeFileSync(__baseOutput + 'home.js', JSON.stringify(result.finalCss));

} catch (err) {
    console.log(err);
    process.exit(1);
    throw err;
} finally {
    await browser.close();
    process.exit(0);
}

})();

`

@peterbe
Copy link
Owner

peterbe commented Feb 26, 2021

I think it's because ;html isn't a valid selector. What does the CSS look like?

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