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.

Error when used in create-react-app build (but not development)

See original GitHub issue

I’m pretty new to web development, so I’m not sure if this is something you can help with. I’m getting an error of the form:

ReferenceError: o is not defined
    at e (blob:http://localhost:5000/2bdae74b-66c2-443f-8a8f-6b18edc7fb4c:1:313)
    at blob:http://localhost:5000/2bdae74b-66c2-443f-8a8f-6b18edc7fb4c:1:352

The stack trace is all minified, but the top looks like this:

e (2bdae74b-66c2-443f-8a8f-6b18edc7fb4c:formatted:23)
(anonymous) (2bdae74b-66c2-443f-8a8f-6b18edc7fb4c:formatted:27)
Worker Created (async)
t.exports (image-blob-reduce.esm.mjs:1613)
w (image-blob-reduce.esm.mjs:1689)
n.acquire (image-blob-reduce.esm.mjs:575)
(anonymous) (image-blob-reduce.esm.mjs:1933)
(anonymous) (image-blob-reduce.esm.mjs:1932)
Promise.then (async)
(anonymous) (image-blob-reduce.esm.mjs:1930)
(anonymous) (image-blob-reduce.esm.mjs:2016)

Is this expected to work with Create React App? Why might it be failing only in a production build? As far as I can tell, everything is fine until I get to a call to toBlob().

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

12reactions
cmdcolincommented, Dec 28, 2020

I had a problem where it looked like this in production

200a1799-9a4c-43ac-ab95-be009946c398:1 Uncaught ReferenceError: i is not defined
    at e (200a1799-9a4c-43ac-ab95-be009946c398:1)
    at 200a1799-9a4c-43ac-ab95-be009946c398:1
e @ 200a1799-9a4c-43ac-ab95-be009946c398:1
(anonymous) @ 200a1799-9a4c-43ac-ab95-be009946c398:1
d1fe213f-35a4-4d4f-883d-072f9df72b55:1 Uncaught ReferenceError: i is not defined
    at e (d1fe213f-35a4-4d4f-883d-072f9df72b55:1)
    at d1fe213f-35a4-4d4f-883d-072f9df72b55:1
e @ d1fe213f-35a4-4d4f-883d-072f9df72b55:1
(anonymous) @ d1fe213f-35a4-4d4f-883d-072f9df72b55:1
f5e4d2fb-8d00-49ba-839d-20318c4a2aff:1 Uncaught ReferenceError: i is not defined
    at e (f5e4d2fb-8d00-49ba-839d-20318c4a2aff:1)
    at f5e4d2fb-8d00-49ba-839d-20318c4a2aff:1
e @ f5e4d2fb-8d00-49ba-839d-20318c4a2aff:1
(anonymous) @ f5e4d2fb-8d00-49ba-839d-20318c4a2aff:1
c61c2004-99b9-4aa4-9e2e-ae247d84ec4b:1 Uncaught ReferenceError: i is not defined
    at e (c61c2004-99b9-4aa4-9e2e-ae247d84ec4b:1)
    at c61c2004-99b9-4aa4-9e2e-ae247d84ec4b:1
e @ c61c2004-99b9-4aa4-9e2e-ae247d84ec4b:1
(anonymous) @ c61c2004-99b9-4aa4-9e2e-ae247d84ec4b:1

I realized it is probably because create-react-app webpack configs doesn’t have great webworker support (have to use worker-loader and rewire or other crazy stuff)

I fixed by turning off the webworker option in the pica instance that we pass to the ImageBlobReduce constructor


//@ts-ignore
import ImageBlobReduce from "image-blob-reduce";
//@ts-ignore
import Pica from "pica";

const pica = Pica({ features: ["js", "wasm", "cib"] });
const reduce = new ImageBlobReduce({ pica });


2reactions
puzrincommented, Nov 19, 2020

Sorry, no ideas, i don’t use react an not familiar with it’s bundler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Error while creating new React app ("You are running ...
1. First clear the cache · 2. Now run this command, this will uninstall the old version, install the latest one and create...
Read more >
react-scripts fails to build project with Node 17 #11562 - GitHub
Describe the bug we have a CRA app, it used to build with Node 14.x very fine, today I upgrade nodejs to 17.0.0...
Read more >
How to fix build failures with `create-react-app` in production
If your build is using create-react-app and has been failing since approximately the 18th of June 2020, this post will help you fix...
Read more >
Troubleshooting - Create React App
Check that your file is imported by your entrypoint. TypeScript will show errors on any of your source files, but webpack only reloads...
Read more >
create-react-app not working ⚠️ error solved - YouTube
In this video, we will solve the error in reactjs that We no longer support global installation of Create React App. ✔️ create...
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