GoogleChromeLabs / critters

🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
https://npm.im/critters-webpack-plugin
Apache License 2.0
3.44k stars 108 forks source link

Unable to locate stylesheet #106

Closed echolimazulu closed 1 week ago

echolimazulu commented 2 years ago

Hello @developit and other contributors,

Thanks to you and the contributors of this project for a job well done.

While working with the critters-webpack-plugin project on macOS, I found that the this.compilation argument was probably redundant, resulting in an exception: https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters-webpack-plugin/src/index.js#L172

I can assume that this is a bug, since readFile: https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts#L33 https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.js#L141

When the specified argument is removed, the assembly works properly.

Plugin version is 3.0.2., Webpack version is 5.

janicklas-ralph commented 2 years ago

That makes sense to me. Could you open a PR with those changes and I can merge

echolimazulu commented 2 years ago

@janicklas-ralph Good morning Janicklas,

Thank you for your attention to this issue.

Please give me some time so that I can take a closer look at this issue, after which I can offer a PR.

echolimazulu commented 2 years ago

@janicklas-ralph Hello,

I did some more research on this problem and found out its cause. Within one day, I plan to provide a solution (in a PR) and the necessary test, due to the lack of which this problem was not detected earlier.

echolimazulu commented 2 years ago

@janicklas-ralph Good evening,

Please check out the solution I provided in PR: https://github.com/GoogleChromeLabs/critters/pull/110

kara commented 1 week ago

Closing this issue because ownership of Critters has moved to the Nuxt team, who will be maintaining the project going forward. This repo is archived and won't receive any future updates.

If the issue is still relevant, please re-post it to the actively-maintained fork at https://github.com/danielroe/beasties.