sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

"Generic type 'Options<sync>' requires 1 type argument(s)" error on `Sass` type #559

Closed DetachHead closed 1 year ago

DetachHead commented 1 year ago

Describe the bug

> tsc
node_modules/svelte-preprocess/dist/types/options.d.ts:29:33 - error TS2314: Generic type 'Options<sync>' requires 1 type argument(s).

29 export declare type Sass = Omit<SassOptions, 'file' | 'data'> & {
                                   ~~~~~~~~~~~

Found 1 error in node_modules/svelte-preprocess/dist/types/options.d.ts:29

To Reproduce

import preprocess from 'svelte-preprocess'

Expected behavior no error

Information about your project:

Additional context workaround is to enable skipLibCheck in tsconfig, which isn't ideal

KotlinIsland commented 1 year ago

I at a loss trying to imagine how a critical type error such as this could make it into production.

DetachHead commented 1 year ago

my guess is because this project uses ts-jest which has a critical issue where it skips most type checking

kaisermann commented 1 year ago

Hey @DetachHead 👋 this will hopefully be fixed in #562.

I at a loss trying to imagine how a critical type error such as this could make it into production.

This is more related to the installed sass version than anything else. At some point, sass changed the signature of the Options type, so here we are.

I've published 5.0.0@next can you try with it?

DetachHead commented 1 year ago

I've published 5.0.0@next can you try with it?

it works, thanks!