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

fixed AbortSignal was also declared here with type check #366

Merged
merged 1 commit into from
May 13, 2023

Conversation

Code-Hex
Copy link
Owner

@Code-Hex Code-Hex commented May 13, 2023

See: microsoft/TypeScript#51567

Problem

$ yarn type-check:yup
yarn run v1.22.19
$ tsc --strict --noEmit example/yup/schemas.ts
node_modules/@types/node/globals.d.ts:72:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'AbortSignal' must be of type '{ new (): AbortSignal; prototype: AbortSignal; abort(reason?: any): AbortSignal; timeout(milliseconds: number): AbortSignal; }', but here has type '{ new (): AbortSignal; prototype: AbortSignal; }'.

72 declare var AbortSignal: {
               ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:2090:13
    2090 declare var AbortSignal: {
                     ~~~~~~~~~~~
    'AbortSignal' was also declared here.


Found 1 error in node_modules/@types/node/globals.d.ts:72

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What's I did to solve this

I did yarn add @types/node -D

@Code-Hex Code-Hex merged commit 1efc73e into main May 13, 2023
@Code-Hex Code-Hex deleted the fix/AbortSignal-conflict branch May 13, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant