-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
<reference no-default-lib="true" /> in bun-types causes vscode to not recognize lib.dom.d.ts types #358
Comments
@colinhacks Thoughts on how we can make this better? |
Tested today and it appears this is still happening. This is pretty similar to the problem cross-fetch had, right? |
Any updates on this? |
Can we not remove the triple-slash directive and set Source: https://stackoverflow.com/a/31696608/612202 & https://basarat.gitbook.io/typescript/type-system/lib.d.ts#lib.d.ts |
Experiencing same issue with navigator and |
I fixed this by creating a /// <reference lib="dom" />
{
"compilerOptions": {
"types": ["bun-types", "./types.d.ts"]
}
}
|
worked like a charm! thank you! 👍 |
faced this as well today. we have no
we're losing the dom types everywhere. The workaround from @iam-medvedev works, but we're in a monorepo so I'd need to do this in every package :/ |
In trying to adopt @iam-medvedev's workaround worked, but It would be nice to have a version of |
We use a workaround for `bun` types due to oven-sh/bun#358 (comment)
I just encountered this issue and I'm a bit shocked that it hasn't been solved yet. I'm not expecting any package I install to override my |
Indeed. I was also looking to incrementally adopt bun, starting with the test framework. However, this issue adds a lot of friction.
Very fast and easy to set up, except for getting the types to work. Fixing this issue would help bun get a foothold in existing codebases. |
Worth noting that this issue is extremely difficult to identify in a large codebase, as TS doesn't point to bun-types as being the problem (the types just stop working) |
I'd like to highlight that this becomes increasingly more important as I was super excited to try out https://bun.sh/blog/the-bun-shell#introducing-the-bun-shell , but it's impractical to use in our project because we can't import At this point, I'd settle for a consistent way to vendor most of |
when I add
bun-types
totsconfig.json
vscode is unable to recognize types fromlib.dom.d.ts
(FormData
,navigator
, etc.).Removing
bun-types
fromtsconfig.json
brings back DOM types but I want but types so I tinkered around. I commented out this line specifically inbun-types
and it seems to have solved the problem. Now I can havebun-types
intsconfig.json
and I'm getting DOM types.https://github.com/Jarred-Sumner/bun/blob/ee83e25120f8ff52fb44d83ac25b965c2cc2b062/packages/bun-types/types.d.ts#L5
The text was updated successfully, but these errors were encountered: