question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not resolve module

See original GitHub issue

Hey guys, I recently ejected my app and updated to ExpoKit 35, and since then, I can’t launch the app on iOS anymore because there’s a problem with the react-native-svg module.

Commands :

  • expo install react-native-svg
  • cd ios && pod install
  • cd .. && expo start -c
  • Build and run on Xcode

Error below :

While trying to resolve module react-native-svg from file /project/assets/illustrations/demo.svg, the package /project/node_modules/react-native-svg/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/project/node_modules/react-native-svg/src/index.ts. Indeed, none of these files exist:

/project/node_modules/react-native-svg/src/index.ts(.native||.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.svg|.native.svg|.svg|.ios.json|.native.json|.json)

/project/node_modules/react-native-svg/src/index.ts/index(.native||.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.svg|.native.svg|.svg|.ios.json|.native.json|.json)

Any of you guys had this issue before ? Any help appreciated 😃

I am currently using the following versions :

Expo : 35.0.0 ExpoKit : 35.0.1 React-native : https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz ( SDK 35 ) React-native-svg : 9.12.0 ( When installing, yarn says that version ~9.9.2 is required, but it gaves me the same error anyways ) CocoaPods : 1.8.3 Xcode : 11.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:26

github_iconTop GitHub Comments

50reactions
RobertMeGustacommented, Oct 24, 2019

I had the same issue, with same steps and same outcome. Figured out that in my app.json i had "packagerOpts": { "config": "metro.config.js", "sourceExts": ["js","jsx","svg",] }, insead of "packagerOpts": { "config": "metro.config.js", "sourceExts": [ "js","jsx","svg","ts","tsx"] }, changing that fixed my issue

16reactions
msandcommented, Oct 23, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Cannot resolve module
1 Answer 1 ... In nodejs, when you call require("script1.js") it won't search in the current folder. You have to use require("./script2.js") ,...
Read more >
How to configure webpack to fix "Can't resolve 'module' from ...
I'm having a hard time to run babel-plugin-macros with a storybook, it seems I need to configure the webpack: I asked the same...
Read more >
How to fix the `can't resolve module` error in Next.js
In a Next.js page your can import methods from a file that loads Node.js modules. This is fine, as long as you also...
Read more >
How do I resolve a 'module not found' error? - Vercel
The 'module not found' error is a syntax error that appears when the static import statement cannot find the file at the declared...
Read more >
Error Cannot resolve module style-loader | Edureka Community
Modify webpack config, add modulesDirectories field in resolve. ... Hope it helps!! answered May 18, 2020 by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found