Gutenberg: When 2 plugins are using the new CSS feature of wp-scripts an error happens.

Created on 26 Jun 2020  路  7Comments  路  Source: WordPress/gutenberg

Describe the bug
This happened when a third party plugin I use updated to use the new feature of wp-scripts. I'm using the new feature also. An error happens when I try to import style.scss files on my block and use the build script. Using the start script is fine, only the build script is not functioning well. As it happens, some of the blocks from the other plugin also went missing.

To reproduce
Steps to reproduce the behavior:

  1. Install Bootstrap Blocks plugin
  2. Create your own plugin with a block that has both editor and style stylesheets.
  3. Run wp-scripts build
  4. See error on console on refresh

Expected behavior
No error would pop up and no blocks from the other plugin will be missing.

Screenshots
If applicable, add screenshots to help explain your problem.

Editor version (please complete the following information):

  • WordPress version: 5.4.2
  • Gutenberg version: 8.3.0

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 83
[Package] Scripts [Priority] High [Type] Regression

Most helpful comment

I have #23710 that fixes the issue at least for the example plugin shared. We should know more after the upcoming npm release planned for later this week.

All 7 comments

Can you share which version of @wordpress/scripts are you using? Is it the latest one? There was an issue with CSS handling that was addressed in https://github.com/WordPress/gutenberg/pull/23127 (v11.0.0).

In the wp-bootstrap-blocks plugin we're using v11.0.0 of the @wordpress/scripts package (see: https://github.com/liip/bootstrap-blocks-wordpress-plugin/blob/master/package-lock.json#L2902). And I could reproduce this error together with a dummy plugin which is using v12.0.0 of the package.

Can you share this dummy plugin? I鈥檇 like to investigate it locally.

Here you go: wp-scripts-plugin.zip

I was also using a v11.0.0 on my plugin but I guess you can reproduce the issue with the mentioned dummy plugin.

I was able to reproduce it myself. Thanks for help 馃憤

It鈥檚 strange that npm start works correctly but nom run builderrors.

I have #23710 that fixes the issue at least for the example plugin shared. We should know more after the upcoming npm release planned for later this week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ellatrix picture ellatrix  路  3Comments

youknowriad picture youknowriad  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments

davidsword picture davidsword  路  3Comments

jasmussen picture jasmussen  路  3Comments