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.

Problem with production version (serve build)

See original GitHub issue

Bug reports:

I’m using the component from an application created using create-react-app, everything works fine as long as I do not build. When I execute:

    npm run build
    serve -s build
    http://localhost:5000/

I see a blank page and this is what i see in console log: image

Something strange seems to happen when I produce the minimized version. Has anyone already had a similar problem?


Please consider also to support this project https://beerpay.io/chrvadala/react-svg-pan-zoom

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
lionkengcommented, Mar 13, 2019

The browser field in react-svg-pan-zoom’s package.json is set to use the UMD bundle. CRA’s build process (ala webpack) is using that field as a hint and end up pulling the UMD bundle to include in your final app build. I believe React only works with es6 classes. The quick-fix here is to change your import statements to explicitly use the ES bundle in this package. For e.g. change import { UncontrolledReactSVGPanZoom } from 'react-svg-pan-zoom' to import { UncontrolledReactSVGPanZoom } from 'react-svg-pan-zoom/build-es'

1reaction
ericksepulvedacommented, Jul 5, 2019

I had this issue and upgrading to v3.1 fixed it BUT it broke the rest of my site layout 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-svg-pan-zoom: Problem with production version (serve ...
The post that solve the problem is on GitHub project page. The browser field in react-svg-pan-zoom's package.json is set to use the UMD ......
Read more >
Making a production version - The Apache Software Foundation!
Making a production version. Releasing an application for consumers. The version in the js-debug folder is considered a “debug version” or “development ...
Read more >
Production order - valid production version issue
our server is in Germany and I am in CST. ... I then created production version and the validity is from nov 19th...
Read more >
Next.js CLI
The Next.js CLI allows you to start, build, and export your application. Learn more about it here.
Read more >
Production | webpack
The goals of development and production builds differ greatly. In development, we want strong source mapping and a localhost server with live reloading...
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