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.

RN 0.59.8 - Unable to resolve module `pegjs`

See original GitHub issue

I’m running the latest version of RN (0.59.8) with the latest version of react-native-svg (9.4.0). When I try to launch the application, both in iOS and Android, I receive the following error:

bundling failed: Error: Unable to resolve module pegjs from /Users/PATH_TO_APP/android/react-native-svg/lib/extract/extractTransform.js: Module pegjs does not exist in the Haste module map

Do you know how I can fix this?

Thanks, Lorenzo

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
flexaddictedcommented, Jun 15, 2019

@kelset @msand I’ve figured out what the problem was.

My Brownfield React Native project was including react-native-svg as a local dependency. In other words, I’ve downloaded the source code of react-native-svg and included it as a module served locally and not as a node module (this was due to fix some problems on the gradle file).

During the migration, Android Studio was building against that module and not the new one available in node_modules. That was causing the error.

I’ve fixed following this guide: https://stackoverflow.com/questions/23025433/how-to-clear-gradle-cache. In particular, I removed the gradle build cache.

Thanks for your support.

0reactions
kelsetcommented, Jun 17, 2019

yeah caches can create so many issues 😦 I’m glad you solved!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RN 0.59.8 - Unable to resolve module pegjs #1007 - GitHub
The latest version has no dependencies at all. This error means you're loading old js in your app. Try clearing caches, reinstall the...
Read more >
Unable to Resolve Module in React Native App - Stack Overflow
Bar ) will be unavailable in your app, and thus RN says unhelpful things like module not found and Indeed, none of these...
Read more >
react native unable to resolve module - You.com | The Search ...
I was reading the error message as "can't resolve a path to the module". So the root cause is, the file it lists...
Read more >
Error: Unable to resolve module `util` – Split Help Center
Running bundle using React Native and Javascript SDK causes an error. Bundling failed: Error: Unable to resolve module `util`.
Read more >
React Native in the browser - Expo Snack
Did you know: You can turn off automatic updates under Devices in the footer? Unable to resolve module '@react-native-community/slider.js ...
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