Could not find a declaration file for module 'use-sound'. 'c:/Users/manish/Documents/auth-fire/node_modules/use-sound/dist/use-sound.esm.js' implicitly has an 'any' type.
There are types at 'c:/Users/manish/Documents/auth-fire/node_modules/use-sound/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'use-sound' library may need to update its package.json or typings.ts(7016)
Could not find a declaration file for module 'use-sound'. 'c:/Users/manish/Documents/auth-fire/node_modules/use-```
This helped resolve my issue.
generated-types
at the same level of tsconfig.jsonindex.d.ts
andtypes.d.ts
files from dist folder of@node-modules/use-sound
and paste them in the above foldertsconfig.json
and addpaths
to it in the below format insidecompilerOptions
This might or might not be the exact correct answer, but this is helpful than
// @ts-ignore
Note: The folder
generated-types
can be named anything and the same name should be reflecting inside theuse-sound
of thepaths
key in tsconfig.jsonWhat I did was make a use-sound.d.ts file Then in the tsconfig.json file add
“typeRoots”: [“./use-sound.d.ts”] inside the compilerOptions
The use-sound.d.ts file looked like this
it works for me on Next JS 13, thanks
Same here. Temporarily fixed by adding
// @ts-ignore
on top of the import, but TypeScript will not be able to provide any type safety for the hook itself. Personally going to hold off from using this package for now.If someone is still getting TS errors while using the useSound hook, then try installing @types/howler along with the above mentioned solution.
I am also having the same issue. I am using it with Next.js13 and Typescript