egoist / poi

⚡A zero-config bundler for JavaScript applications.
https://poi.js.org
MIT License
5.23k stars 255 forks source link

"Unknown word" error during CSS minification #771

Closed chopfitzroy closed 3 years ago

chopfitzroy commented 3 years ago

I get the following error when running poi --prod, (poi --serve works fine), it appears to be occurring in an imported module as I have disabled all *.css importing from the source files that I am trying to build.

> applications/default
> poi --prod

Error: CSS minification error: applications/default/assets/css/chunk-vendors.8fe840ed.chunk.css:577:3: Unknown word. File: assets/css/chunk-vendors.8fe840ed.chunk.css
    at common/temp/node_modules/.pnpm/@intervolga/optimize-cssnano-plugin@1.0.6_webpack@4.44.2/node_modules/@intervolga/optimize-cssnano-plugin/index.js:106:21
    at async Promise.all (index 0)

I tried adding the following to the poi.config.js:

    config.module
    .exclude
    .add(/node_modules/)
    .end();

Unfortunately this caused issues with other packages that are working.

Additionally I tried with the --no-minimize flag and setting output.minimize to false in the poi.config.js but neither seem to resolve the issues so despite the error I am not entirely sure that it is a cssnano issue specifically? The file assets/css/chunk-vendors.8fe840ed.chunk.css appears to be removed when the process falls over? Is there anyway to get to this file and figure out what is causing the issue?

chopfitzroy commented 3 years ago

Just updated all my packages and this was resolved, I have no idea where the "word" was coming from but it has been fixed regardless.