You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While upgrading to the latest version of Nuxt, i've encountered a typings problem while customizing the loader options for SASS/SCSS.
TS2322: Type '{ sassOptions: { includePaths: string[]; }; }' is not assignable to type 'Options'.
Object literal may only specify known properties, and 'sassOptions' does not exist in type 'Options'.
8 | loaders: {
9 | scss: {
> 10 | sassOptions: {
| ^^^^^^^^^^^^^^
> 11 | // include assets path as absolute path for scss imports
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 12 | includePaths: [path.resolve(__dirname, "./src/assets")],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 13 | },
| ^^^^^^^^^^
14 | },
15 | },
16 | },
SassOptions is referencing @types/sass directly and since build.scss.sassOptions is a property added by sass-loader, it doesn't exist in the interface and thus gives an error.
There seems to be a change between @nuxt/types@2.14.12 and @nuxt/types@2.15.0 which caused the issue to plop up for me, since downgrading to 2.14.12 removed the error message for me.
It should be an easy fix though, since there are typings for sass-loader which has the correct typings for the loader and the required modules included.
While upgrading to the latest version of Nuxt, i've encountered a typings problem while customizing the loader options for SASS/SCSS.
SassOptions is referencing @types/sass directly and since
build.scss.sassOptions
is a property added by sass-loader, it doesn't exist in the interface and thus gives an error.https://github.com/nuxt/nuxt.js/blob/558227f628cc5453be4cec16bf15dcb397baacae/packages/types/config/build.d.ts#L11
https://github.com/nuxt/nuxt.js/blob/558227f628cc5453be4cec16bf15dcb397baacae/packages/types/config/build.d.ts#L69-L70
There seems to be a change between
@nuxt/types@2.14.12
and@nuxt/types@2.15.0
which caused the issue to plop up for me, since downgrading to2.14.12
removed the error message for me.It should be an easy fix though, since there are typings for
sass-loader
which has the correct typings for the loader and the required modules included.Versions
Reproduction
https://github.com/marcopixel/nuxt-sassoptions-repro
Steps to reproduce
npm install
npm run dev
What is Expected?
The example should run without any errors caused by TS and should not show any errors in VSCode.
What is actually happening?
The example builds & runs fine, but shows the error while issue checking in the console & inside VSCode.
The text was updated successfully, but these errors were encountered: