Quernest/mui-modal-provider

๐Ÿ› Missing 'dist/modal.esm.js' in package

s-weigand opened this issue ยท 2 comments

First of all thanks for the awesome package, it makes opening dialogs a whole lot easier โค๏ธ

I just installed your package and got this error:
'./dist/modal.esm.js' does not exist, did you mean './dist/index.js'?'

Locally I hot fixed the issue by removing the "module" line from package.json in your installed package.

- "module": "dist/modal.esm.js",
  "main": "dist/index.js",

Looking at the tree of the installfolder

tree node_modules/mui-modal-provider
node_modules/mui-modal-provider
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ dist
โ”‚   โ”œโ”€โ”€ ModalContext.d.ts
โ”‚   โ”œโ”€โ”€ ModalProvider.d.ts
โ”‚   โ”œโ”€โ”€ constants.d.ts
โ”‚   โ”œโ”€โ”€ index.d.ts
โ”‚   โ”œโ”€โ”€ index.js
โ”‚   โ”œโ”€โ”€ mui-modal-provider.cjs.development.js
โ”‚   โ”œโ”€โ”€ mui-modal-provider.cjs.development.js.map
โ”‚   โ”œโ”€โ”€ mui-modal-provider.cjs.production.min.js
โ”‚   โ”œโ”€โ”€ mui-modal-provider.cjs.production.min.js.map
โ”‚   โ”œโ”€โ”€ mui-modal-provider.esm.js
โ”‚   โ”œโ”€โ”€ mui-modal-provider.esm.js.map
โ”‚   โ”œโ”€โ”€ reducer.d.ts
โ”‚   โ”œโ”€โ”€ test-utils
โ”‚   โ”‚   โ”œโ”€โ”€ LegacyModal.d.ts
โ”‚   โ”‚   โ”œโ”€โ”€ Modal.d.ts
โ”‚   โ”‚   โ””โ”€โ”€ index.d.ts
โ”‚   โ”œโ”€โ”€ types.d.ts
โ”‚   โ”œโ”€โ”€ useModal.d.ts
โ”‚   โ””โ”€โ”€ utils.d.ts
โ””โ”€โ”€ package.json

I guess this line should be changed into (tested works)

- "module": "dist/modal.esm.js",
+ "module": "dist/mui-modal-provider.esm.js",

Hi @s-weigand, thank you!
I just published a new version of the package, can you check it out?

Awesome thanks for the quick fix, it works like a charm ๐Ÿ˜„