'When I install react-zoom-pan-pinch, it not contains the src folder, and I get error on build

When I install zoom-pan-pinch (https://github.com/prc5/react-zoom-pan-pinch#install), I get missing file errors:

WARNING in ./node_modules/react-zoom-pan-pinch/dist/index.esm.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '...\node_modules\react-zoom-pan-pinch\src\components\transform-component.tsx' file: Error: ENOENT: no such file or directory, open '...\node_modules\react-zoom-pan-pinch\src\components\transform-component.tsx'        
 @ ./src/pilots/PanZoomPilot.js 5:0-76
 @ ./src/App.js 11:0-49 35:43-55
 @ ./src/index.js 7:0-24 11:33-36

... (and a lot more)

The whole node_modules\react-zoom-pan-pinch\src directory is missing, however, the dist is in place.

Removing node_modules and run npm install again is not working.

How can I force to use the dist version? Or how can I fix this build issue? I am not a node expert, sorry for the dumb question.

Update:

the module itself is working, but the log contains this mess.



Solution 1:[1]

Looks like this is a known issue with an open (at the time of writing!) pull request: https://github.com/prc5/react-zoom-pan-pinch/pull/266

Let's hope it gets merged soon!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jack