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

typescript error #39

Closed
iwansantoso opened this issue Oct 29, 2022 · 1 comment · Fixed by #40
Closed

typescript error #39

iwansantoso opened this issue Oct 29, 2022 · 1 comment · Fixed by #40

Comments

@iwansantoso
Copy link

Hi.
I'm coding using TypeScript and install this library using npm. But I encounter following error on import { getOriginPrivateDirectory } from "native-file-system-adapter";

Could not find a declaration file for module 'native-file-system-adapter'. '{my project folder}/node_modules/native-file-system-adapter/src/es6.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/native-file-system-adapter` if it exists or add a new declaration (.d.ts) file containing `declare module 'native-file-system-adapter';`

I think ["types": "types"] in package.json should be modified to ["types": "./types/mod.d.ts"].

@ChrisLFieldsII
Copy link

Hi. I'm coding using TypeScript and install this library using npm. But I encounter following error on import { getOriginPrivateDirectory } from "native-file-system-adapter";

Could not find a declaration file for module 'native-file-system-adapter'. '{my project folder}/node_modules/native-file-system-adapter/src/es6.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/native-file-system-adapter` if it exists or add a new declaration (.d.ts) file containing `declare module 'native-file-system-adapter';`

I think ["types": "types"] in package.json should be modified to ["types": "./types/mod.d.ts"].

This is correct. I ran into this trying to use this pkg with TS.

Had to go into node_modules/native-file-system-adapter/package.json and change types field to "types": "types/mod.d.ts" and then reload typescript in VSCode and I now have proper TS support

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

Successfully merging a pull request may close this issue.

2 participants