question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Large number of Source Map Loader warnings when React starts

See original GitHub issue

When I start my React app, I get 28 warnings in the console from react-zoom-pan-pinch, all about the source-map-loader:

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'

I’m using the latest version 2.1.3. I’ve tried searching for a solution but cannot find anything straightforward. As far as I understand, it may be something in the react-zoom-pan-pinch distribution is trying to reference the source files, which aren’t available on the npm install.

Would appreciate if anybody knows how to resolve this as I want to generate source maps in development (and whilst I don’t mind if I have them or not for this module) it would be nice to clean up the large number of console warnings.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

6reactions
Abe27342commented, Dec 17, 2021

Ah, yes, that is fair. I don’t use create-react-app myself but from reading through their docs I believe your understanding is correct that you would need to do manual config management after ejecting. (If it really bothers you, you could always copy the “src” folder into the package on disk in your node_modules folder 😛)

I don’t maintain this package, but I opened #266 for the simple solution of including “src” in the list of published files.

4reactions
janaagaard75commented, Nov 19, 2022

I have released a fork as @pronestor/react-zoom-pan-pinch that fixes this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is this error coming from source-map-loader and how do ...
I've been trying to debug this for an hour now, but have made little to no progress. This error is coming from a...
Read more >
Troubleshooting Source Maps for React - Sentry Documentation
Once completed, use the sourcemaps explain command, by calling it with the event ID that can be found at the top of the...
Read more >
source-map-loader - webpack
source -map-loader allows webpack to maintain source map data continuity across libraries so ease of debugging is preserved. The source-map-loader will extract ...
Read more >
Optimizing Performance - React
By default, React includes many helpful warnings. These warnings are very useful in development. However, they make React larger and slower so you...
Read more >
JavaScript Debugging with Sourcemaps - TrackJS
If you're using Angular 2, React, Om, Elm, or others, there are huge advantages to debugging by using sourcemaps. We'll show you what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found