Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob undefined #36

Closed
wiredots01 opened this issue Sep 4, 2017 · 15 comments
Closed

Blob undefined #36

wiredots01 opened this issue Sep 4, 2017 · 15 comments

Comments

@wiredots01
Copy link

ReferenceError: Blob is not defined at Object.<anonymous> (/Users/wiredots/Projects/new/reactproject/node_modules/react-qr-reader/lib/index.js:26:24) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.module.exports.Object.defineProperty.value

@JodusNodus
Copy link
Owner

Can you give more details please? What is the environment (browser, nodejs, unit test) etc

@wiredots01
Copy link
Author

chrome, node 6.11.2, jest, mac, using arc base react

@JodusNodus
Copy link
Owner

Check this #35

@JodusNodus
Copy link
Owner

Let me know if that fixes it

@wiredots01
Copy link
Author

dont have problems on test.
when i run the app it stops on this
screen shot 2017-09-04 at 8 02 17 pm

@JodusNodus
Copy link
Owner

Are you trying to server render it ?

@wiredots01
Copy link
Author

nope.. im using react-qr-reader on the client

@JodusNodus
Copy link
Owner

What is your bundle build pipline?

@wiredots01
Copy link
Author

i think you are right, there is something on the server rendering that includes the react-qr-code. thanks a lot.

@RachelAntion
Copy link

How did you resolve this? I'm running into the same issue.

@tomyfalgui
Copy link

Same here, using it in electron with next.js, whenever I refresh the main window, the error appears

@JodusNodus
Copy link
Owner

The module uses many things that are browser specific. I'm not familiar with next.js but you should be able to avoid rendering it server side.

@JodusNodus
Copy link
Owner

@RachelAntion Just shallow render your components, or conditionally render it or a placeholder based on the environment (node or browser).

@powderham
Copy link

@JodusNodus can you give me an example of conditional rendering in react using the environment?

@wiredots01
Copy link
Author

ive made a condition if(!config.isServer) { var QrReader = require('react-qr-reader'); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants