Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin incorrectly extends Plugin_2 error when typechecking vite.config.ts with exactOptionalPropertyTypes flag #7843

7 tasks done
DetachHead opened this issue Apr 21, 2022 · 2 comments · Fixed by #8701


Copy link

DetachHead commented Apr 21, 2022

Describe the bug

> tsc -p tsconfig.node.json

node_modules/vite/dist/node/index.d.ts:1270:26 - error TS2430: Interface 'import("C:/Users/amogus/IdeaProjects/network-chungus/node_modules/vite/dist/node/index").Plugin' incorrectly extends interface 'import("C:/Users/amogus/IdeaProjects/network-chungus/node_modules/rollup/dist/rollup").Plugin'.
  Types of property 'load' are incompatible.
    Type '((this: PluginContext, id: string, options?: { ssr?: boolean; } | undefined) => LoadResult | Promise<LoadResult>) | undefined' is not assignable to type 'LoadHook'.
      Type 'undefined' is not assignable to type 'LoadHook'.

1270 export declare interface Plugin extends Plugin_2 {

Found 1 error in node_modules/vite/dist/node/index.d.ts:1270

Reproduction (run tsc in the terminal)

System Info

    OS: Windows 10 10.0.19042
    CPU: (6) x64 Intel(R) Core(TM) i5-8600 CPU @ 3.10GHz
    Memory: 2.01 GB / 15.78 GB
    Node: 16.9.1 - C:\Program Files\nodejs\node.EXE
    npm: 7.24.1 - C:\Program Files\nodejs\npm.CMD
    Chrome: 99.0.4844.84
    Edge: Spartan (44.19041.1266.0), Chromium (99.0.1150.55)
    Internet Explorer: 11.0.19041.1566

Used Package Manager



No response


Copy link

For a workaround, set skipLibCheck: true in tsconfig.node.json.

Copy link

DetachHead commented Apr 21, 2022

yeah that's what i'm doing for now, however i try to avoid doing that though as it disables type checking on all *.d.ts files

@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging a pull request may close this issue.

2 participants