-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed as not planned
Labels
Milestone
Description
Describe the bug
@types/node are pulled in via transitive dependencies of @sveltejs/kit/types/index.d.ts
The problem is @types/node clobbers some libdom.d.ts definitions with incompatible node variations.
Reproduction
npm install @types/wicg-file-system-access
edit the tsconfig.json to add
"types": ["wicg-file-system-access"],
edit index.svelte to add
<script>
/** @type {Promise<any>}*/
let openFile = null;
function onOpen() {
openFile = doOpenFile();
}
async function doOpenFile() {
const [handle] = await showOpenFilePicker();
const file = await handle.getFile();
/** @type {ReadableStream}*/
const stream = file.stream();
const reader = stream.getReader();
const result = await reader.read();
const decoder = new TextDecoder();
return decoder.decode(result.value);
}
</script>
<button on:click={onOpen}>Open</button>
{#await openFile}
waiting
{:then result}
{result}
{/await}
file.stream() should be a ReadableStream but is a NodeJS.ReadableStream because node has clobber the type for Blob.
Logs
No response
System Info
N/ASeverity
serious, but I can work around it
Additional Information
No response
Reactions are currently unavailable