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

hoistUseStatements not working #203

Open
augnustin opened this issue Jun 23, 2022 · 1 comment
Open

hoistUseStatements not working #203

augnustin opened this issue Jun 23, 2022 · 1 comment

Comments

@augnustin
Copy link

I get the following error on every component with custom styles:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):                                                                                        friendly-errors 14:02:41
SassError: @use rules must be written before any other rules.
  ╷
3 │ @use "sass:list";
  │ ^^^^^^^^^^^^^^^^
  ╵
  pages/dashboard.vue 3:1  root stylesheet

With the following config:

nuxt.config.js:

  buildModules: [
    '@nuxtjs/style-resources',
    '@nuxtjs/vuetify',
  ],
  styleResources: {
    // your settings here
    scss: ['~/assets/uses.scss'],
    hoistUseStatements: true  // Hoists the "@use" imports. Applies only to "sass", "scss" and "less". Default: false.
   },

use.scss:

@use "sass:list";
@use 'sass:math';

package.json:

    "vue": "^2.6.14",
    "@nuxtjs/style-resources": "^1.2.1",
    "nuxt": "^2.15.8",
    "sass-loader": "^10.2.0",
    "sass": "~1.32.13",

No idea how to further test things or bring any useful info.

@rchl
Copy link
Collaborator

rchl commented Jun 23, 2022

Maybe prepare a simple project that reproduces because very similar setup (without vuetify) works for me.

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

2 participants