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

Hi was getting this weird error #229

Open
DyerMaker42 opened this issue Dec 29, 2024 · 0 comments
Open

Hi was getting this weird error #229

DyerMaker42 opened this issue Dec 29, 2024 · 0 comments

Comments

@DyerMaker42
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-qrcode-svg@6.3.12 for the project I'm working on.

Basically crashed my app with error that looked like this


error: Error: Unable to resolve module react-native-svg/css from /Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js: react-native-svg/css could not be found within the project or in these directories:
  node_modules
  1 | import React from "react";
> 2 | import { LocalSvg } from "react-native-svg/css";
    |                           ^
  3 | import { SvgUri, SvgXml } from "react-native-svg";
  4 | import { isString, isUrlString } from "../utils";
  5 |
    at ModuleResolver.resolveDependency (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:162:15)
    at DependencyGraph.resolveDependency (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/node-haste/DependencyGraph.js:260:43)
    at Object.resolve (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/lib/transformHelpers.js:177:21)
    at Graph._resolveDependencies (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/DeltaBundler/Graph.js:432:35)
    at Graph._processModule (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/DeltaBundler/Graph.js:218:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Graph._addDependency (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/DeltaBundler/Graph.js:314:20)
    at async Promise.all (index 5)
    at async Graph._processModule (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/DeltaBundler/Graph.js:263:5)
    at async Graph._addDependency (/Users/nicholas-mbp-fuego/bitbucket/settl-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/DeltaBundler/Graph.js:314:20)
npm verbose cwd /Users/nicholas-mbp-fuego/bitbucket/settl-app

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js b/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js
index 6c5b14a..392c763 100644
--- a/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js
+++ b/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js
@@ -1,5 +1,5 @@
 import React from "react";
-import { LocalSvg } from "react-native-svg/css";
+import { LocalSvg } from 'react-native-svg';
 import { SvgUri, SvgXml } from "react-native-svg";
 import { isString, isUrlString } from "../utils";
 

Basically changed one of the index.native.js files line 2 to import { LocalSvg } from 'react-native-svg/css'
This issue body was partially generated by patch-package.

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

1 participant