Comments (19)
Hey @nayeemrmn , does #23902 also fix this issue? We had to go back to 1.43.3 to avoid this issue.
Yes! Looks like #23902 restores the behaviour from 1.43.3.
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.
I think I know why that's happening, will look into it.
from deno.
Have to say this is a super frustrating bug.
I had Redis imported import { createClient } from 'redis';
via import map { "redis": "npm:@redis/[email protected]" }
which was working fine, until it started reporting all types as any
.
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.
from deno.
Restarting the extensions or Deno server may also help. Its worked for me when cached deps get wacky or undetected sometimes.
from deno.
- This happens to me in Deno less than 1.43.4
- Change it from
@deno-type
to@deno-types
- Run
deno check --all main.ts
. You'll see something like this indicating missing@types/node
package:> deno check --all main.ts Check file:///V:/scratch/main.ts error: TS2580 [ERROR]: Cannot find name 'Buffer'. export type TypeParser<I extends (string | Buffer), T> = (value: I) => T; ~~~~~~ at file:///V:/.cache/deno/npm/registry.npmjs.org/pg-types/4.0.2/index.d.ts:67:44 ...etc...
- I bet in your code you originally had
/// <reference types="npm:@types/node" />
? It seems to not be working in the lsp right now (I opened #23879). Instead do this and it will make things work:import type {} from "npm:@types/node";
from deno.
Thanks for replying @dsherret!
- I can replicate that, but only occasionally. It seems that reinstalling Deno is reloading the cache and it has a chance of failing for each reload.
- It is
@deno-types
in my code, sorry for typo in the issue. - I can replicate that, the errors even goes into Deno itself.
- No I didn't have that, but I added
/// <reference lib="deno.unstable" />
myself.
Usingimport type {} from "npm:@types/pg";
does remove the type errors for a while. But it starts failing again shortly after I save the file, it never recovers from the type errors even with the new import.
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);
from deno.
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.
from deno.
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.
from deno.
Hey @nayeemrmn , does #23902 also fix this issue? We had to go back to 1.43.3 to avoid this issue.
from deno.
@nayeemrmn this may be related, I upgraded to v1.43.5 from v1.43.1, and now, detected types from:
import { Tokenizer } from "npm:[email protected]"
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?
from deno.
@osddeitf Yes, I believe it should
from deno.
from deno.
@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 @deno-types
alone it is still failing in the exact same way, is there any internal cache of Deno that I should clear before retrying?
from deno.
@vicary For me it works after editing the file one time, as mentioned in #23878 (comment). Can you check this?
from deno.
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
from deno.
@vicary Try just adding a space at the end of the file while the red squiggly is there. Do they go away?
from deno.
@nayeemrmn Yes, saving the file does make it go away. Is it meant to behave like this on each start?
from deno.
@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.
from deno.
@dgreensp @vicary The secondary issue appears to be fixed by denoland/deno_graph#487, please try it out with deno upgrade --canary
!
from deno.
@nayeemrmn Confirming that canary 14a74600de6f1c206ffe4750f6cb6da59657db8e
fixes the issue, thanks a lot!
from deno.
Related Issues (20)
- Publishing JSR pkg that resolves to npm workspace member that's a JSR dep should error?
- deno compile: node addons gets error `missing symbol called`
- Compilation error during cargo install HOT 4
- `node:tty` -> N.WriteStream.prototype.hasColors is not a function
- File with just `+` does not report syntax error HOT 3
- Websocket behaviour change since 1.44.3 HOT 4
- No way to specify specific abstract socket name with `--allow-read/write`.
- Import error on startup when a Fresh project is a workspace member HOT 3
- Non-zero exit code in a test case causes the test to fail since 1.44.0
- `deno test --watch` should always print the full test output HOT 2
- proposal: add `Deno.ConfigFile` HOT 4
- “client error (SendRequest)” when fetching certain https URLs over proxy
- deno publish failed with error: error[excluded-module] when export casing differs from file casing HOT 5
- For loop does not works as expected HOT 2
- Deno APIs missing in Deno runtime HOT 1
- PermissionDenied (EACCES code) when trying to reading files from network-mapped drive
- ERR_MULTIPLE_CALLBACK is thrown during running `test` script in commander.js repo
- deno cache --vendor does not generate an import map HOT 1
- deno cache --vendor does not let me choose a folder name
- node WriteStream leaks in deno tests HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno.