MABelanger / react-html5-camera-photo

HTML5 camera photo
https://www.npmjs.com/package/react-html5-camera-photo
MIT License
207 stars 94 forks source link

TypeError: Object(...) is not a function #8

Closed chadutah closed 6 years ago

chadutah commented 6 years ago

I yarn upgraded everything but i'm still getting this error I'm using chrome. Any help would be amazing!

MABelanger commented 6 years ago

Can you send me your packages.json, because i can't reproduce the bug.

chadutah commented 6 years ago

{ "name": "mern", "version": "1.0.0", "description": "", "main": "server.js", "scripts": { "start": "if-env NODE_ENV=production && npm run start:prod || npm run start:dev", "start:prod": "node server.js", "start:dev": "concurrently \"nodemon --ignore 'client/*'\" \"npm run client\"", "client": "cd client && npm run start", "seed": "node scripts/seedDB.js && node scripts/seedsGamesDB.js", "install": "cd client && yarn install", "build": "cd client && npm run build", "heroku-postbuild": "npm run build" }, "author": "", "license": "ISC", "devDependencies": { "concurrently": "^3.5.0", "nodemon": "^1.11.0" }, "dependencies": { "ajax": "^0.0.4", "axios": "^0.18.0", "bcrypt": "^3.0.0", "body-parser": "^1.17.2", "cloudinary": "^1.11.0", "connect-mongo": "^2.0.1", "expo": "^29.0.0", "express": "^4.15.4", "express-session": "^1.15.6", "if-env": "^1.0.4", "jquery": "^3.3.1", "mongoose": "^5.0.17", "morgan": "^1.9.0", "passport": "^0.4.0", "passport-local": "^1.0.0", "react-awesome-modal": "^2.0.3", "react-bootstrap": "^0.32.1", "react-camera": "^0.1.3", "react-facebook-auth": "^1.4.0", "react-facebook-login": "^4.0.1", "react-html5-camera-photo": "^1.2.3-beta.0", "react-native": "^0.56.0", "react-table": "^6.8.6", "reactstrap": "^6.2.0", "shuffle-array": "^1.0.1", "whatwg-fetch": "^2.0.4" } }

chadutah commented 6 years ago

this is the client

chadutah commented 6 years ago

{ "name": "mern", "version": "0.1.0", "private": true, "proxy": "http://localhost:3001/", "dependencies": { "axios": "^0.16.2", "cloudinary": "^1.11.0", "expo": "^29.0.0", "jquery": "^3.3.1", "react": "^16.0.0", "react-awesome-modal": "^2.0.3", "react-bootstrap": "^0.32.1", "react-camera": "^0.1.3", "react-dom": "^16.0.0", "react-facebook-auth": "^1.4.0", "react-html5-camera-photo": "^1.2.3-beta.0", "react-native": "^0.56.0", "react-router-dom": "^4.1.2", "react-scripts": "1.0.14", "reactstrap": "^6.2.0" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } }

chadutah commented 6 years ago

it works when i fist load the component, then i'm sending the picture to cloudinary which also works then i take the url from cloudinary and send it up to the kairos api and with the response from kairos i trigger a function and a modal and this is when it breaks and gives me that error

chadutah commented 6 years ago

I just changed my modals to alerts everything works fine

chadutah commented 6 years ago

so the issue is when you try to put a modal in the same div as the camera

MABelanger commented 6 years ago

Maybe is when the component is unmonted, the alert keep the component mounted.

MABelanger commented 6 years ago

Can you see in the stack of error something ?

MABelanger commented 6 years ago

Ok i found a way to reproduce the bug. I will update a new version ;) I will notify you when i will do

chadutah commented 6 years ago

thank you so much!

MABelanger commented 6 years ago

Ok thank for reporting the issue ! You can upgrade to the fixed version react-html5-camera-photo@1.2.4-beta.0