Closed ishetnogferre closed 1 year ago
Same here but with ProcessWire as a CMS.
Yep, I'm fixing it right now... it should be bundled as CommonJS by default, not ESM.
Well, that was fun. The actual issue was that the critical
package moved to be ESM-only, and rollup-plugin-critical
is shipped with both CJS and ESM versions.
So I had to dynamically import the critical
ESM into rollup-plugin-critical
to allow it to work for both CJS and ESM builds.
The current tests all passed, because they operate on the ESM build; I'll have to investigate that further at some point, to see if I can add a real-world test trying to import and use rollup-plugin-critical
for both ESM and CJS.
Fixed in 1.0.12 -> https://github.com/nystudio107/rollup-plugin-critical/releases/tag/1.0.12
I updated to latest version, but the error still occurs to me. Deleted node_modules and reinstalled everything.
@jmartsch please verify that the new version is actually installed?
I've tested this on an external project that demonstrated the issue, and it worked fine. You might try nuking your node_modules
directory and package-lock.json
and installing from scratch.
Deleted package-lock.json and reinstalled. Throws no error now, but also seems to not generate the crititcal-css. But might be another problem on my side. I am checking tomorrow.
FWIW, the test project I mentioned generated the critical CSS properly
Describe the bug
In a Craft & Vite project after following the docs and including the standard setup in the vite.config.js plugins section, following error keeps showing after running the commands for serving or building:
To reproduce
Steps to reproduce the behaviour:
Expected behaviour
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions