Skip to content
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

ReadableStream.from not supported if a fresh app is a subfolder #2412

Open
sergeysolovev opened this issue Apr 21, 2024 · 6 comments
Open

ReadableStream.from not supported if a fresh app is a subfolder #2412

sergeysolovev opened this issue Apr 21, 2024 · 6 comments

Comments

@sergeysolovev
Copy link

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

@marvinhagemeister
Copy link
Collaborator

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?

@sergeysolovev
Copy link
Author

sergeysolovev commented Apr 21, 2024

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

@sergeysolovev
Copy link
Author

If it helps, I shared my deno.jsonc in this issue, it’s still the same.

@marvinhagemeister
Copy link
Collaborator

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?

@sergeysolovev
Copy link
Author

Oh I see. I don’t have tripple slash comments in dev.ts. Removing the from main.ts doesn’t help with the issue.

@lucacasonato
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants