style-resources icon indicating copy to clipboard operation
style-resources copied to clipboard

"SassError: expected selector." (mixins)

Open n4ks opened this issue 2 years ago • 0 comments

Hello! I'm trying to import mixins using this library, but I get this error:

ERROR in ./assets/styles/index.scss (./node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!./node_modules/postcss-loader/src??ref--7-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--7-oneOf-1-3!./node_modules/sass-resources-loader/lib/loader.js??ref--7-oneOf-1-4!./assets/styles/index.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: expected selector.
   ╷
19 │ @mixin test{
   │  ^ 
   ╵
  assets\styles\index.scss 19:2  root stylesheet

nuxt.config.js

buildModules: [
		"@nuxt/typescript-build",
		'@nuxtjs/style-resources',
		"@nuxtjs/svg",
	]
styleResources: {
    scss: ['~assets/vars.scss', '~assets/_mixins.scss',],
      },

_mixins.scss

@mixin test {
	list-style: none;
}

package.json

"sass": "^1.38.1",
"sass-loader": "^10.1.1",
"nuxt": "^2.15.7",
"@nuxtjs/style-resources": "^1.2.1",

This error is displayed dozens of times referring to different files. (I don't use this mixin anywhere at the moment). Could you help me understand what could be causing this problem? Thank you!

n4ks avatar Apr 28 '22 15:04 n4ks