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.

ReferenceError: _typeof is not defined /w CRA 2.0

See original GitHub issue

Using Create-React-App v2.0 i get the following error in the console, when loading Quagga. The webcam loads up fine, and displays an image, but it will not scan barcodes.

blob:http://localhost:3000/b34a09e5-04a0-495f-bcc5-91af1e544d8b:1472 Uncaught ReferenceError: _typeof is not defined

Below you can see a (maybe) more clear version of what i’m seeing. screen shot 2018-10-10 at 15 35 50

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
LimmaPauluscommented, Jun 11, 2021

I managed to bypass this problem with the following import:

import Quagga from 'quagga/dist/quagga';
1reaction
cedmcommented, Apr 17, 2019

I’m getting the same error, but not using CRA.

I’m running a fairly basic Rails 5 with Webpack setup, and the _typeof is not defined error happens when I use the Quagga NPM package and load it via Webpack (import Quagga from 'quagga'). If I bypass Webpack and link to it directly via a <script scr="quagga.min.js"> tag (I manually downloaded the quagga.min.js file from Github), everything works fine.

I don’t understand what the issue is…

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: React is not defined - Migrating from CRA to ...
The issue stemmed from CRA using the new jsx runtime to auto-import React into jsx files. Vite doesn't use the new jsx runtime...
Read more >
How to solve "window is not defined" errors in React and Next.js
First solution: typeof​​ Because typeof won't try to evaluate "window", it will only try to get its type, in our case in Node....
Read more >
"Uncaught ReferenceError: process is not defined" and the ...
The Uncaught ReferenceError: process is not defined happens when when a non-existent (here: process) variable is referenced .
Read more >
Typeof +pi gives an error that typeof is not defined at string to ...
The fix to this is simple and everyone is overthinking it. look at the error. it says typof is not defined, thats because...
Read more >
Static Type Checking - React
Flow extends the JavaScript language with a special syntax for type annotations. ... These instructions are not for Create React App users.
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