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

error TS2304: Cannot find name 'TransformStream' 'ReadableStream' 'WritableStream' #1040

Closed
qmonmert opened this issue May 9, 2024 · 8 comments · Fixed by #1043
Closed

Comments

@qmonmert
Copy link

qmonmert commented May 9, 2024

Since 9.0.1, when i do npm install:

node_modules/execa/types/stdio/type.d.ts:56:52 - error TS2304: Cannot find name 'TransformStream'.

56  | Unless<IsSync, DuplexTransform | WebTransform | TransformStream>;
                                                      ~~~~~~~~~~~~~~~

node_modules/execa/types/stdio/type.d.ts:78:63 - error TS2304: Cannot find name 'ReadableStream'.

78  | Unless<IsSync, (AsyncIterable<unknown> & ProcessStdinFd) | ReadableStream>;
                                                                 ~~~~~~~~~~~~~~

node_modules/execa/types/stdio/type.d.ts:88:19 - error TS2304: Cannot find name 'WritableStream'.

88  | Unless<IsSync, WritableStream>;
                     ~~~~~~~~~~~~~~

node_modules/execa/types/transform/normalize.d.ts:54:22 - error TS2304: Cannot find name 'TransformStream'.

54  readonly transform: TransformStream;
                        ~~~~~~~~~~~~~~~


Found 4 errors in 2 files.

Errors  Files
     3  node_modules/execa/types/stdio/type.d.ts:56
     1  node_modules/execa/types/transform/normalize.d.ts:54
```

An idea? Thanks a lot
@qmonmert qmonmert closed this as completed May 9, 2024
@ehmicky
Copy link
Collaborator

ehmicky commented May 9, 2024

Hi @qmonmert,

It appears you might have solved this problem.
Would you like to share how to solved it so that other users with the same problem can fix it too? Thanks!

@qmonmert
Copy link
Author

qmonmert commented May 9, 2024

@ehmicky no I don't fix it, I was not sure if it was a real problem, but if you have the same problem I reopen

@ehmicky ehmicky reopened this May 9, 2024
@ehmicky
Copy link
Collaborator

ehmicky commented May 9, 2024

Which --target and --lib TypeScript compiler options are you using?
Also, what is your version of @types/node?

@qmonmert
Copy link
Author

qmonmert commented May 9, 2024

@ehmicky "target": "ES2022" "lib": ["ES2022"] "@types/node": "20.11.25",

@ehmicky
Copy link
Collaborator

ehmicky commented May 9, 2024

This is a bug from Execa.

We now support web streams, but we are importing their types from the DOM instead of from @types/node. Therefore, users would now need to do --lib es2022,dom, which they should not have to.

I opened a PR at #1043 to solve this.

@sindresorhus
Copy link
Owner

We now support web streams, but we are importing their types from the DOM instead of from @types/node.

I would argue this is a @types/node bug. They are globals in Node.js and should be globals in the types too.

@ehmicky
Copy link
Collaborator

ehmicky commented May 10, 2024

Yes, they are using the NodeJS interface for the web stream globals, for some reason. 🤔

@qmonmert This should now be fixed in 9.0.2

@qmonmert
Copy link
Author

@ehmicky it works perfectly, thanks

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 a pull request may close this issue.

3 participants