GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.37k stars 82 forks source link

cannot find name ‘FileSystemFileHandle. #121

Closed aradhyakalva closed 1 year ago

aradhyakalva commented 2 years ago

"Version used -"browser-fs-access": "^0. 31.01 "ts-node": "~9.1. 11 "typescript": "~4.3.5", node v14.17.6 npm v6.14.15

Issue

Below error is showing up in logs while starting the application

Error: libs/node modules/browser-fs-access/index.d.ts:147:20 - error TS2304: Cannot find name 'FileSystemFileHandle'

existingHandle?: FilesystemFileHandle | null,

Error: libs/node modules/browser-fs-access/index.d.ts:157:30 - error TS2304: Cannot find name 'FilesystemFileHandle'

filePickershown?: (handle: FileSystemFileHandle | null) => void | null

Error: libs/node modules/browser-fs-access/index.d.ts:158:12 - error Is2304: cannot find name "FilesystemFileHandle"

: Promise;

tomayac commented 2 years ago

This seems to be caused by the same root issue as https://github.com/tldraw/tldraw/pull/660#issuecomment-1113170053. In this thread, @andarist was mentioned as potentially being able to help.

Andarist commented 2 years ago

@tomayac I'm on vacation rn but I might take a look in a week when I get back. Don't hesitate to ping me again if I don't - sometimes things just slip through the cracks

tomayac commented 2 years ago

Enjoy your vacation! If we find a fix for this, eventually tldraw could use the module as a direct dependency, rather than maintaining a local copy.

Andarist commented 1 year ago

@aradhyakalva the most likely fix for your problem is to add this to your tsconfig.json::

{
  "compilerOptions": { "lib": ["DOM"] }
}
tomayac commented 1 year ago

This seems to be fixable as per the instructions given in the comment above.