template-react-component-library icon indicating copy to clipboard operation
template-react-component-library copied to clipboard

Error: Could not resolve entry module (dist/esm/types/index.d.ts)

Open vgarmes opened this issue 4 years ago • 8 comments

Issue is fixed when adding "rootDir": "src" in tsconfig.json file.

vgarmes avatar Dec 28 '21 23:12 vgarmes

@vgarmes -

I included rootDir in tsconfig, but doesn't solve the warning that occurs in another project that uses lib.

Did you make any other changes?

lwazevedo avatar Feb 22 '22 16:02 lwazevedo

@lwazevedo I can't remember now, but feel free to check the repo I started back then: https://github.com/vgarmes/ui-library

vgarmes avatar Mar 01 '22 19:03 vgarmes

Change dist/esm/types/index.d.ts -> dist/esm/index.d.ts in rollup.config.js

cuonghx-dev avatar Jul 29 '22 03:07 cuonghx-dev

Solution: https://stackoverflow.com/questions/73197460/error-could-not-resolve-entry-module-react-rollup/73784872#73784872

hane-smitter avatar Sep 17 '22 12:09 hane-smitter

Adding "declarationMap": true in tsconfig.json solved this issue for me.

AbhinavRobinson avatar Jan 09 '23 12:01 AbhinavRobinson

In my case, simply adding "rootDir": "src" in tsconfig.json has solved the issue.

zahidshowrav avatar Jun 19 '23 02:06 zahidshowrav

in rollup.config.mjs, change plugins: [dts()] to plugins: [dts.default()]

Prathyush-KKK avatar Sep 27 '23 20:09 Prathyush-KKK

Renaming my file from file.d.ts to file.ts worked

lacymorrow avatar Apr 13 '24 21:04 lacymorrow