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

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

Comments

@DetachHead
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

https://stackblitz.com/edit/vitejs-vite-rtb2e8 (run tsc in the terminal)

System Info

System:
    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
  Binaries:
    Node: 16.9.1 - C:\Program Files\nodejs\node.EXE
    npm: 7.24.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    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

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

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

@DetachHead
Copy link
Author

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants