browser-fs-access icon indicating copy to clipboard operation
browser-fs-access copied to clipboard

cannot find name ‘FileSystemFileHandle.

Open aradhyakalva opened this issue 3 years ago • 4 comments

"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<FileSystemFileHandle I null>;

aradhyakalva avatar Jul 19 '22 02:07 aradhyakalva

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.

tomayac avatar Jul 19 '22 07:07 tomayac

@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

Andarist avatar Jul 19 '22 08:07 Andarist

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.

tomayac avatar Jul 19 '22 08:07 tomayac

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

{
  "compilerOptions": { "lib": ["DOM"] }
}

Andarist avatar Aug 08 '22 18:08 Andarist

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

tomayac avatar Aug 22 '22 12:08 tomayac