-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
@deno-types breaks at 1.43.4 #23878
Comments
|
Thanks for replying @dsherret!
Attaching my `main.ts` here for more context, it is a Deno Fresh project./// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
/// <reference lib="deno.unstable" />
import "$std/dotenv/load.ts";
import { start } from "$fresh/server.ts";
import config from "./fresh.config.ts";
import manifest from "./fresh.gen.ts";
await start(manifest, config); |
I think I'm running into the same problem. Previously, this worked to apply particular types to a JS file: // @deno-types="./foo.d.ts"
export * from "./foo.js"; Recently, it started to work flakily, and as of 1.43.5 it might be not working at all now. |
Correction, it is working flakily. For example, after editing deno.jsonc to add an unrelated lint rule: Errors start showing up across the project. After modifying the file containing the code I quoted in the previous comment and re-saving it: Errors go away. |
Hey @nayeemrmn , does #23902 also fix this issue? We had to go back to 1.43.3 to avoid this issue. |
Have to say this is a super frustrating bug. I had Redis imported Only now realised this is the cause (upgrading to v1.43.4 or v1.43.5). Downgrading to v1.43.3 fixes the issue as @bombillazo mentioned above. |
Yes! Looks like #23902 restores the behaviour from 1.43.3.
I think I know why that's happening, will look into it. |
@nayeemrmn this may be related, I upgraded to v1.43.5 from v1.43.1, and now, detected types from: Will your PR fix that as well? |
@osddeitf Yes, I believe it should |
I just want to say I am also seeing errors about symbols not being found,
or being used as a type when only found as a value, or vice versa (sorry I
didn’t note down the exact error), in the form of red squiggly lines
appearing in VS Code, that do not seem to be related to either NPM or
deno-types, but that go away while I’m clicking on files in the sidebar.
Transient errors. Noticeable upon changing deno.json or a setting that
restarts the language server.
This feels like the biggest regression in Deno quality of experience upon
upgrading in a while. I guess it makes some sense there would be glitches
if there were large changes to how the language server works. And from
other comments it sounds like downgrading Deno is a possibility if I need
to; I’ve never tried that.
…On Tue, May 21, 2024 at 8:10 AM osddeitf ***@***.***> wrote:
@nayeemrmn <https://github.com/nayeemrmn> this may be related, I upgraded
to v1.43.5 from v1.43.1, and now, detected types from:
import { Tokenizer } from ***@***.***"
changed from parse5/7.1.2/dist/tokenizer/index.d.ts to
parse5/7.1.2/dist/tokenizer/index.js
Will your PR fix that as well?
—
Reply to this email directly, view it on GitHub
<#23878 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABGBJSVAV2FO2ZVZFYK2ETZDNPWFAVCNFSM6AAAAABH5LNG4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSHA2TMNRZHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@nayeemrmn After upgrading to 1.43.6, the only reliable way is the workaround of importing the type separately. import type {} from "npm:@types/pg"; With |
@vicary For me it works after editing the file one time, as mentioned in #23878 (comment). Can you check this? |
I can reliably reproduce the error by relaunching VS Code or restarting Deno Language Server via command palette. Screen.Recording.2024-05-23.at.05.03.52.mov |
@vicary Try just adding a space at the end of the file while the red squiggly is there. Do they go away? |
@nayeemrmn Yes, saving the file does make it go away. Is it meant to behave like this on each start? |
Restarting the extensions or Deno server may also help. Its worked for me when cached deps get wacky or undetected sometimes. |
@bombillazo Restarting via either means is the exact method to reproduce the issue right now. I am sorry, but that is the opposite of helping in this context. |
@dgreensp @vicary The secondary issue appears to be fixed by denoland/deno_graph#487, please try it out with |
@nayeemrmn Confirming that canary |
Version: Deno 1.43.4, Deno 1.43.5
Given the following import
The following function call is correctly typed until Deno 1.43.3:
After upgrading to Deno 1.43.4+
pg.types
fails to resolve its types, subsequently leading to a lint failure on(val) =>
being implicitany
.In VS Code, navigating to the type definition shows
[errored]
.But the language server output doesn't seem to report anything.
The text was updated successfully, but these errors were encountered: