moaazsidat / react-native-qrcode-scanner

A QR code scanner component for React Native.
MIT License
2.03k stars 513 forks source link

React-native-web with QrCode-Scanner #334

Open Gameworl opened 3 years ago

Gameworl commented 3 years ago

hello, I am trying to put the qrcode scanner on react-native-web, but can't get it to work. I get this error:

ERROR in ../node_modules/react-native-qrcode-scanner/index.js 68:6
Module parse failed: Unexpected token (68:6)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     cameraType: 'back',
|     notAuthorizedView: (
>       <View
|         style={{
|           flex: 1,

Build details?

 "@react-native-community/masked-view": "^0.1.10",
    "ios-deploy": "^1.11.4",
    "react": "^17.0.2",
    "react-native": "0.64.0",
    "react-native-camera": "^3.43.9",
    "react-native-easing-keyframes": "^1.0.2",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-keyframes": "^2.0.1",
    "react-native-qrcode-scanner": "^1.5.4",
    "react-native-reanimated": "^2.1.0",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.1.0",
    "react-native-sound": "^0.11.0",
    "react-native-web": "^0.16.1",
    "react-native-web-sound": "^0.1.1"
cuong1999 commented 2 years ago

insert this code in web.config.js path.resolve(appDirectory, 'node_modules/react-native-qrcode-scanner'),