react-masked-input icon indicating copy to clipboard operation
react-masked-input copied to clipboard

Error: ENOENT: no such file or directory

Open carloscalage opened this issue 2 years ago • 1 comments

Hey guys!

I just started to use this package on my project. I installed using pnpm install react-hook-mask , implemented and tested on my component. Everything went well and worked as expected, but after that I got 9 warnings like this one on my terminal:

...
WARNING in ../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-hook-mask/dist/esm/utils/mask.js
Module Warning (from ../../node_modules/.pnpm/[email protected][email protected]/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/..../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-hook-mask/src/utils/mask.ts' file: Error: ENOENT: no such file or directory, open '/..../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-hook-mask/src/utils/mask.ts'

webpack compiled with 9 warnings (3d483ff870fdd4f9)

I checked and it's trying to reach a folder at react-hook-mask/src and looking at this location I don't have this folder, just dist/.

So I don't know if this is something with me as I'm the only one having this problem here or maybe it's a bug with pnpm or NX. Can someone give me some help? I tried removing and installing again or just using pnpm install and still having this problem...

carloscalage avatar Nov 13 '23 07:11 carloscalage

@carloscalage, I can see that you are using the latest version. I never saw the error you posted, but I also never used pnpm. Can you try using only npm and see if the error still happens, if the error goes away, it should be something to do with pnpm. If there is some setting to add to this library to avoid the error with pnpm, I may release a new version with the changes, but first I need to know what is causing that issue.

Regarding only having the dist folder, that is intentional and you can see it at https://www.npmjs.com/package/react-hook-mask?activeTab=code, but I can consider releasing the src code together if that solves the issue. My guess is that it's trying to find the source ts file from the mappings, but it's not found because it's not released in npm. That should be as simple as adding src at the "files": section in package.json.

lucasbasquerotto avatar Nov 13 '23 13:11 lucasbasquerotto