Open sergeysolovev opened 4 months ago
Based on the issue title and the description I tried to guess how you're using ReadableStream.from
, but I feel like the description is missing that part. Can you share more about that? How do we reproduce the issue?
Sorry about vague description. By “I can not use” I meant that vscode doesn’t like the “from” word of ReadableStream.from([1, 2, 3])
expression and gives the following info in the tooltip:
Property 'from' does not exist on type '{ new (underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number | undefined; } | undefined): ReadableStream
; new <R = any>(underlyingSource: UnderlyingDefaultSource<...>, strategy?: QueuingStrategy<...> | undefined): ReadableStream<...>; new <R = any>(underlyingSource?: UnderlyingSourc...'.deno-ts(2339)
The script runs and deno check
gives no issues about it. So I guess this issue is related to vscode. Please let me know what else is missing
If it helps, I shared my deno.jsonc in this issue, it’s still the same.
Thanks for providing more context. This sounds like it's a type issue. Does removing the tripple slash comments in main.ts
and dev.ts
help?
Oh I see. I don’t have tripple slash comments in dev.ts. Removing the from main.ts doesn’t help with the issue.
I think the issue here is that Preact always loads dom
types, and Deno LSP does not support different global types in different folders of a project. cc @nayeemrmn
I have a fresh app as a folder of bigger project with root deno.jsonc. I used this guide to achieve this: https://fresh.deno.dev/docs/examples/changing-the-src-dir
As a result I can not use
ReadableStream.from
in other part of my code which has nothing to do with the fresh app. It only works if I do both these changes in my deno.jsonc: 1) Comment out jsx and jsxImportSource in compilerOptions; 2) add folder with fresh app to the “exclude” list.Apart that it’s a bit unexpected and difficult to find sort of issue, how to actually make it work? Would appreciate any help