For the following import in a typescript nodejs app
import { pipeline } from "stream/promises";
vscode / eslint is complaining Unable to resolve path to module 'stream/promises'
This started occurring all of a sudden.
node -v v16.13.2
pnpm -v 6.29.1
"@types/node": "^17.0.12"
stream/promises
is part of node. I've confirmed that the pipeline function and typescript type exist and work and the overall app still functions.
console.log({ pipeline }); // { pipeline: [Function: pipeline] }
Importing just stream
works with no complaints. I've confirmed this error on a Windows 10 and Linux computer. Whats going on and how to resolve it without ignoring it?
import { pipeline }
I get auto-suggestion tofrom 'stream'
. Probably that's how it should be imported, otherwise it might think 'stream/promises' is a file path? – Protoactiniumpipeline
. The async version is found understream/promises
– Carcinogen