react-zoom-pan-pinch icon indicating copy to clipboard operation
react-zoom-pan-pinch copied to clipboard

Source maps contain the links to the absent `src` folder

Open zaycker opened this issue 10 months ago • 1 comments

Describe the bug Source maps included to the npm module contain the links to the src folder, while there is no src folder in the package. As a result the webpack development build in the project that uses react-zoom-pan-pinch warns about missing files. In the version 3.6.1 source maps contained sourcesContent property with the contents of those files from src and webpack had no need to resolve the files from sources list, it just used the content of files from the sourcesContent. In the 3.7.0 sourcesContent contains [null, null, null....].

To Reproduce Steps to reproduce the behavior:

  1. Go to npm package page
  2. Click on 'Code'
  3. Find source maps (both for CommonJs and for ESM)
  4. Check the sources and sourcesContent properties

Expected behavior Either the module should contain src folder or sourcesContent property should be filled with sources content

Screenshots

Desktop (please complete the following information):

  • OS: Win and MacOS

zaycker avatar Mar 04 '25 07:03 zaycker

sourcesContent is returned back again when returned back sourceMap: false to the typescript rule. magic...

typescript({ sourceMap: false, declaration: false }),

seems like it is @rollup/plugin-typescript problem, there are couple of issues in rollup/plugins repo with the keyword source

https://github.com/rollup/plugins/issues/1832

I have tried to setup a gazillion times sourcemapping with rollup + ts but never had luck. There's always a bug somewhere.

zaycker avatar Mar 04 '25 08:03 zaycker