xr0master / chartjs-react

Tiny, written in TS, based on React hooks wrapper for Chart.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot resolve relative imports

re-thc opened this issue · comments

Hi, when trying to run this library (great work for supporting chartjs 3.0) the error below appears:

Rollup failed to resolve import "utils/noop" from "..\node_modules\chartjs-react\es\ReactChart.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`rollupInputOptions.external`

There's a similar error for generateID

It looks like it's because utils/noop and utils/generate-id/generateID aren't specified as relative imports, i.e. with ./ in front, so it thinks it's a separate module elsewhere (and tries to find it in node_modules). Thanks!

Hey. Thank you for report.
Yes, you are right, it's because I am using paths in tsconfig. It's better to remove it.

"paths": {
      "*": ["src/*"]
}

fixed in v3.1.2