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 i upgrade node 22 from 16, i can't use “@use ‘’ as *" replace @import #7466

Closed
Felix-d-eng opened this issue Dec 3, 2024 · 2 comments

Comments

@Felix-d-eng
Copy link

Version

5.0.8

Environment info

this my config in vue.config.js 
css: {
    loaderOptions: {
      scss: {
        additionalData: `@use "~@/assets/styles/_styles.scss" as *;`
      },
    },
    extract: { ignoreOrder: true },
  },

my _stlye.css file :
@use "**/reset" as *;
@use "**/utilities" as *;
@use "**/colors" as *;
@use "**/mixins" as *;
i use @use replace @import, project can't run now, my console shows the following
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.
   ╷
11 │   @include size(100%, 100%);
   │   ^^^^^^^^^^^^^^^^^^^^^^^^^
SassError: Undefined $green_300.
         $green_300

I found that I can't use any parameters and methods

Steps to reproduce

@use replace @import from project when node upgrade to 22

What is expected?

It works fine

What is actually happening?

project can't run and console show all parameter, method undefined but i can find parameter from file introduced by @use

@Felix-d-eng
Copy link
Author

I use @use "" as * to replace the import of all scss files in the project

@Felix-d-eng
Copy link
Author

@use is only used in a specific scope. I reference @used after the SASS file, and it works normally.But I don't know why I wrote '@use ** as *' in vue.config.js. It only works in the Vue file and not in the SASS file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant