-
-
Notifications
You must be signed in to change notification settings - Fork 297
Description
After upgrading to react-zoom-pan-pinch@3.7.0, Webpack throws multiple warnings related to missing source files referenced in the .map files of the library.
The .js.map files included in the dist directory refer to .tsx and .ts source files that are not published with the npm package, causing source-map-loader to throw warnings during build.
To Reproduce
Steps to reproduce the behavior:
Install react-zoom-pan-pinch@3.7.0 in a TypeScript + Webpack project
Ensure source-map-loader is enabled in Webpack
Run npm start
See warnings like:
WARNING in ./node_modules/react-zoom-pan-pinch/dist/index.esm.js
Failed to parse source map from '.../node_modules/src/hooks/use-controls.tsx': ENOENT: no such file or directory
Expected behavior
The package should not include .map files that reference source files that do not exist in the published package. Either:
The .map files should be excluded from the npm package, or
The original source files should be included to allow proper source mapping
Node version: 18.x
Webpack version: 5.x
Additional context
This issue was not present in version 3.4.4. It appears to have started with the inclusion of .map files in the package from version 3.7.0.
Until resolved, this can be worked around by excluding the package in source-map-loader config:
Please consider fixing the package publishing configuration. Happy to help if needed.