Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
npmDude opened this issue Jun 26, 2020 · 7 comments · Fixed by #23710
Closed

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

npmDude opened this issue Jun 26, 2020 · 7 comments · Fixed by #23710
Labels
[Priority] High Used to indicate top priority items that need quick attention [Tool] WP Scripts /packages/scripts [Type] Regression Related to a regression in the latest release

Comments

@npmDude
Copy link

npmDude commented Jun 26, 2020

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
@gziolo gziolo added [Tool] WP Scripts /packages/scripts Needs Testing Needs further testing to be confirmed. labels Jun 26, 2020
@npmDude npmDude changed the title When 2 plugins are using the new CSS feature of wp-scripts an error is happens. When 2 plugins are using the new CSS feature of wp-scripts an error happens. Jun 29, 2020
@gziolo
Copy link
Member

gziolo commented Jul 3, 2020

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 #23127 (v11.0.0).

@tschortsch
Copy link

tschortsch commented Jul 3, 2020

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.

@gziolo
Copy link
Member

gziolo commented Jul 3, 2020

Can you share this dummy plugin? I’d like to investigate it locally.

@tschortsch
Copy link

Here you go: wp-scripts-plugin.zip

@npmDude
Copy link
Author

npmDude commented Jul 3, 2020

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

@gziolo
Copy link
Member

gziolo commented Jul 4, 2020

I was able to reproduce it myself. Thanks for help 👍

It’s strange that npm start works correctly but nom run builderrors.

@gziolo gziolo added [Type] Regression Related to a regression in the latest release [Priority] High Used to indicate top priority items that need quick attention and removed Needs Testing Needs further testing to be confirmed. labels Jul 4, 2020
@gziolo
Copy link
Member

gziolo commented Jul 6, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] High Used to indicate top priority items that need quick attention [Tool] WP Scripts /packages/scripts [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants