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

SASS deprecation message (legacy JS API) #65585

Closed
2 tasks done
n3f opened this issue Sep 23, 2024 · 5 comments
Closed
2 tasks done

SASS deprecation message (legacy JS API) #65585

n3f opened this issue Sep 23, 2024 · 5 comments
Labels
[Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended

Comments

@n3f
Copy link
Contributor

n3f commented Sep 23, 2024

Description

I apologize if this is covered elsewhere but it didn't seem to be discovered with a search for sass legacy.

npx wp-scripts build should complete without errors, but shows deprecated message:

LOG from ./node_modules/sass-loader/dist/cjs.js sass-loader ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/style.scss
<w> Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
<w>
<w> More info: https://sass-lang.com/d/legacy-js-api
<w>
<w> null

LOG from ./node_modules/sass-loader/dist/cjs.js sass-loader ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/editor.scss
<w> Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
<w>
<w> More info: https://sass-lang.com/d/legacy-js-api
<w>
<w> null

Step-by-step reproduction instructions

  1. npx @wordpress/create-block my-custom-block
  2. cd my-custom-block
  3. npx wp-scripts build

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@n3f n3f added the [Type] Bug An existing feature does not function as intended label Sep 23, 2024
@n3f
Copy link
Contributor Author

n3f commented Sep 23, 2024

It's possible that #37044 is related.

@ALJ
Copy link

ALJ commented Oct 4, 2024

I just started seeing this same deprecation notice today after a fresh install of @wordpress/scripts:

<w> Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
<w> 
<w> More info: https://sass-lang.com/d/legacy-js-api
<w> 
<w> null

I believe this is related to dart-sass using the legacy JS API still. Version 1.79.0 was released two weeks ago and emits these warnings: sass/dart-sass#2343

I can reliably prevent the warnings by forcing the use of the "modern" JS API by adding the line api: "modern" as a new option in line 206 of wordpress/scripts webpack.config.js. Like this:

loader: require.resolve( 'sass-loader' ),
options: {
	sourceMap: ! isProduction,
	api: "modern",
},

@ALJ
Copy link

ALJ commented Oct 4, 2024

Hi @n3f if you're able to add more labels to this issue, I think the [Package] Scripts GitHub label is appropriate, in addition to the existing bug label.

@n3f
Copy link
Contributor Author

n3f commented Oct 4, 2024

Unfortunately it looks like I don't have the ability to add/edit tags here.

@gziolo
Copy link
Member

gziolo commented Dec 7, 2024

Fixed with #67572. Tested with @wordpress/[email protected]. The stable version is expected to be published to npm on Wednesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants