Skip to content

sass-loader warnings about legacy api #10632

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

Open
3 tasks done
rextambua opened this issue Oct 10, 2024 · 1 comment
Open
3 tasks done

sass-loader warnings about legacy api #10632

rextambua opened this issue Oct 10, 2024 · 1 comment
Labels
bug-pending-triage Reported bug, pending triage to confirm.

Comments

@rextambua
Copy link

Issue Description

when i use the suggested way to silence the warnings arising from discontinued use of legacy api for sass like this webpack.mergeWebpack({
module: {
rules: [
{
test: /.s[ac]ss$/i,
use: [
"css-loader",
{
loader: "sass-loader",
options: {
api: "modern",
sassOptions: {
quietDeps: true,
},
},
},
],
},
],
}, it doest work

Reproduction

using nativescript project with webpack compiler, no sass installed, only coming from dependencies

Relevant log output (if applicable)

ERROR in ./app/views/programs/modals/ModalOrder.vue?vue&type=style&index=0&id=560a21e7&lang=scss&scoped=true& (./node_modules/@nativescript/webpack/dist/loaders/apply-css-loader/index.js!./node_modules/@nativescript/webpack/dist/loaders/css2json-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-7[0].rules[0].use[3]!./node_modules/sass-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-8[0].rules[0].use[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./app/views/programs/modals/ModalOrder.vue?vue&type=style&index=0&id=560a21e7&lang=scss&scoped=true&)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
expected "{".
  ╷
2 │ import ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js";
  │                                                                                                                   ^
  ╵
  app/views/programs/modals/ModalOrder.vue 2:115  root stylesheet
 @ ./app/views/programs/modals/ModalOrder.vue?vue&type=style&index=0&id=560a21e7&lang=scss&scoped=true& 1:0-669 1:0-669
 @ ./app/views/programs/modals/ModalOrder.vue 6:15-100
 @ ./node_modules/@nativescript/webpack/dist/loaders/nativescript-worker-loader/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-3[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./app/views/programs/Product.vue?vue&type=script&lang=ts& 10:0-64 27:8-18 362:35-45
 @ ./app/views/programs/Product.vue?vue&type=script&lang=ts& 1:0-295 1:311-314 1:316-608 1:316-608
 @ ./app/views/programs/Product.vue 2:0-59 3:0-54 3:0-54 14:2-8
 @ ./app/routes.ts 17:0-51 58:19-26
 @ ./app/app.ts 16:0-34 83:21-27

Environment

No response

Please accept these terms

@rextambua rextambua added the bug-pending-triage Reported bug, pending triage to confirm. label Oct 10, 2024
@jkatins
Copy link

jkatins commented Oct 31, 2024

This works for me:

webpack.mergeWebpack({
  ignoreWarnings: [
    (warning) =>
      warning.module &&
      warning.module.resource &&
      /@nativescript\/theme\/(default|core)\.scss/.test(
        warning.module.resource
      ),
  ],
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-pending-triage Reported bug, pending triage to confirm.
Projects
None yet
Development

No branches or pull requests

2 participants