Closed mutewinter closed 2 years ago
I don't receive the same error as you. The typing may be a bit confusing, however enableBlurUp
is defaulted to true when not specified. The function overload specifies that if enableBlurUp
is explicitly set to true
or not specified at all, the return value should contain placeholder: 'blur'
. If enableBlurUp
is explicitly set to false
, the return value should contain placeholder: 'empty'
.
Would you mind sharing your tsconfig.json with me? Perhaps this is the result of a specific Typescript setting.
Sure, here's my TypeScript config:
{
"exclude": ["node_modules", "../node_modules"],
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"lib": ["dom", "dom.iterable", "esnext"],
"target": "es6",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveConstEnums": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
}
}
I've just pushed the provided fix, check out release 3.1.6 to see if this has fixed your issue!
Confirmed fixed!
Good to hear!
Versions
next-sanity-image@3.1.5
typescript@4.3.5
The Error
The Source
Here are the types in the current version of the NPM package:
The Possible Fix
I believe the issue is that
enableBlurUp: false
should beenableBlurUp?: false
.