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
If exactOptionalPropertyTypes is set to true in tsconfig, then props implementations using withDefault will get an error when adding undefined to the type.
Argument of type '{ hoge: undefined; }' is not assignable to parameter of type 'InferDefaults<Readonly<Omit<{ hoge?: string | undefined; }, never> & {}>>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'hoge' are incompatible.ts(2379)
For now, we are using @ts-ignore or modifying the runtime declaration, but we would like to write it in type-based format if possible.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Operating System: Darwin
Node Version: v18.0.0
Nuxt Version: 3.4.1
Nitro Version: 2.3.3
Package Manager: yarn@1.22.19
Builder: vite
User Config: -
Runtime Modules: -
Build Modules: -
IDE: VSCode 1.77.3
volar 1.2.0
Reproduction
https://stackblitz.com/edit/github-6rhv3z?file=components/Hoge.vue
Describe the bug
If
exactOptionalPropertyTypes
is set totrue
in tsconfig, then props implementations usingwithDefault
will get an error when adding undefined to the type.The following error occurs
For now, we are using
@ts-ignore
or modifying the runtime declaration, but we would like to write it in type-based format if possible.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: