You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following static checking error pops up with import { Rating } from "@smastrom/react-rating".
Could not find a declaration file for module '@smastrom/react-rating'. '/path/to/node_modules/@smastrom/react-rating/dist/index.mjs' implicitly has an 'any' type.
There are types at '/path/to/node_modules/@smastrom/react-rating/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@smastrom/react-rating' library may need to update its package.json or typings.ts(7016)
There was a mistake with my tsconfig.json. typeRoots should be ["./node_modules/@types", "./node_modules/*"]. However, this doesn't fix the static checking problem.
I should also mention that even with the temporary fix, there is not auto completion with Rating in my IDE.
Hi @alicia-lyu, sorry for getting back to you so late. Yes, there was indeed an issue with react-rating package.json exports field which affected NextJS 13.
I just released a new version that fixes it and adds support for the app router.
Hi @alicia-lyu, sorry for getting back to you so late. Yes, there was indeed an issue with react-rating package.json exports field which affected NextJS 13.
I just released a new version that fixes it and adds support for the app router.
The following static checking error pops up with
import { Rating } from "@smastrom/react-rating"
.Environment
tsconfig.json:
My temporary solution
I added a new file
react-rating.d.ts
in the root directory with the following code:The error is resolved.
The text was updated successfully, but these errors were encountered: