Incorrect `d.ts` file generation from `runtime` folder
Describe the bug
The following type is generated in the file dist/runtime/store/store.d.ts
export declare const useAuthStore: () => {
getAuthInfo: () => Promise<void>;
authInfo: Readonly<import("vue").Ref<{
readonly userId?: number | undefined;
readonly login?: string | undefined;
} | undefined>>;
isLoadingAuthInfo: Readonly<import("vue").Ref<boolean>>;
authInfoError: Readonly<import("vue").Ref<Readonly<unknown>>>;
};
The following type should be generated
export declare const useAuthStore: () => {
getAuthInfo: () => Promise<void>;
authInfo: {
readonly userId?: number | undefined;
readonly login?: string | undefined;
} | undefined;
isLoadingAuthInfo: readonly boolean;
authInfoError: readonly unknown;
};
Reproduction
Open StackBlitz and go to dist/runtime/store/store.d.ts
Interesting. I wonder if this is an issue with vue-tsc, which is generating these types...
@danielroe hi, did I understand correctly that I need to create an issue on vue-tsc? And how can I properly explain the problem to them, considering that I'm using @nuxt/module-builder, which uses vue-tsc somewhere under the hood?
@danielroe Hi, is there any progress on this issue?
@manniL hi, can you please tell me if there is any progress on this issue?
@danielroe Hi, is there any progress on this issue?
Looks like I have a similar problem
This is how TS outputs the types:
export declare const useAuthInfo: () => {
authInfo: Readonly<import("vue").Ref<{
readonly userId?: number | undefined;
readonly login?: string | undefined;
} | undefined, {
readonly userId?: number | undefined;
readonly login?: string | undefined;
} | undefined>>;
};
See https://stackblitz.com/edit/stackblitz-starters-ayewdt. It's not an issue with @nuxt/module-builder. Possibly an upstream one in https://github.com/vuejs/core.