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-typesat the same level of tsconfig.jsonindex.d.tsandtypes.d.tsfiles from dist folder of@node-modules/use-soundand paste them in the above foldertsconfig.jsonand addpathsto it in the below format insidecompilerOptionsThis might or might not be the exact correct answer, but this is helpful than
// @ts-ignoreNote: The folder
generated-typescan be named anything and the same name should be reflecting inside theuse-soundof thepathskey 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-ignoreon 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