I had the same issue with the planetscale-stream-ts library. It turns out it was related to compilerOptions.moduleResolution
in tsconfig.json
.
When I set it to NodeNext
, I received the same error. However, when I set it to Node
or Bundler
, the error went away.
Since I plan on using tsx
to run the code, I'm going to use Bundler
.
https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html