Expensify / react-native-qrcode-svg

A QR Code generator for React Native based on react-native-svg and node-qrcode.
MIT License
1.06k stars 213 forks source link

react-native-svg v13 support #164

Open GunnarAK opened 1 year ago

GunnarAK commented 1 year ago

v13 dropped a month ago

npm i react-native-qrcode-svg
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: royaltee@0.0.1
npm ERR! Found: react-native-svg@13.2.0
npm ERR! node_modules/react-native-svg
npm ERR!   react-native-svg@"^13.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-svg@"^12.1.0" from react-native-qrcode-svg@6.1.2
npm ERR! node_modules/react-native-qrcode-svg
npm ERR!   react-native-qrcode-svg@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/gunnark/.npm/eresolve-report.txt for a full report.
AndreiBelokopytov commented 1 year ago

+1 for this issue

kaycklbr commented 1 year ago

Up

romarpla commented 1 year ago

+1 having the same error

B0Y3R commented 1 year ago

+1 having some issue

GunnarAK commented 1 year ago

@awesomejerry I wanted to have a look at upgrading this myself, but I got stuck with installing the example app locally. I'm using node 14 (via nvm). Installing root package.json first, then example package.json. Via npm install

The Metro packager is not able to locate the react-native-qrcode-svg package as it is a symbolic link in the app's node_modules. And as far as I'm aware after 5 years and counting Metro still does not support sym links https://github.com/facebook/metro/issues/1

So how do you go about this? There's no documentation inside the example project which would be of help here unfortunately.

Error example:

iOS Bundling failed 220ms
Unable to resolve module react-native-qrcode-svg from /Users/gunnark/Repositories/personal/react-native-qrcode-svg/example/App.js: react-native-qrcode-svg could not be found within the project or in these directories:
  node_modules
  ../node_modules

Also, why does the example app have both a yarn.lock & package-lock.json file?

emmanuelmahove commented 1 year ago

+1 also experiencing this issue

ansh-dagha commented 1 year ago

+1 having same error

brad-ps commented 1 year ago

+1 same here

onkr0d commented 1 year ago

+1 same issue

1level1 commented 1 year ago

+1

ccoloma commented 1 year ago

Until #166 is merged, you can use the overrides field on your package.json if npm is >=8.3.0

{
  ...
  "dependencies": {
    ...
    "react-native-qrcode-svg": "^6.1.2",
    "react-native-svg": "^13.6.0",
    ...
  },
  "overrides": {
    "react-native-qrcode-svg": {
      "react-native-svg": "$react-native-svg"
    }
  },
  ...
}
BraveEvidence commented 1 year ago

This should help you https://www.youtube.com/watch?v=SfWKPIVoS8w&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=4