Rei
Rei12mo ago

Bun - not working typescript intellisense on imported npm modules

Hi, when I'm using Bun as a runtime I don't get any typescript info when I'm importing non-standard npm modules, like here:
import { thingThatDoesntExist } from "zod";


export async function main(

) {
thingThatDoesntExist("mario");
}
import { thingThatDoesntExist } from "zod";


export async function main(

) {
thingThatDoesntExist("mario");
}
This example doesn't error in editor on app.windmill.dev when using Bun, but it shows an error when using Deno. Is it a bug or just Bun limitation?
No description
7 Replies
rubenf
rubenf12mo ago
We use typescript lsp that does some autodiscovery of types but possibly zod require a separate type packages that lsp doesn't autodiscover ?
Rei
Rei12mo ago
zod has built-in typescript declarations
Rei
Rei12mo ago
No description
rubenf
rubenf12mo ago
I'm not sure why typescript lsp doesn't pick them up at the moment
Rei
Rei12mo ago
it works with common packages like express, but If I try to import something different like aws-sdk it doesn't work
rubenf
rubenf12mo ago
unfortunately the typescript lsp we use for bun is not as good as the one for deno we could improve it by doing more efforts in that direction
Rei
Rei12mo ago
it is not that important, I can always edit scripts in my local vscode and it works fine there, but I would be grateful! thanks for help