Skip to content

Invalid CSS found while evaluating ${url} #410

Description

@oguzhanaslan

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);
}

})();

`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions