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

Anyone familiar with Error: While trying to resolve module @turf/bbox? #3689

Open
huedaya opened this issue Nov 11, 2024 · 9 comments
Open

Comments

@huedaya
Copy link

huedaya commented Nov 11, 2024

Environment

  • Dev OS: OSX 15.1
  • @rnmapbox/maps version: 0.41.2
  • React Native version: 0.68.5
  • Expo version: no expo

Steps to reproduce

Installing recent version still not work in me, anyone familiar with this error?

error: Error: While trying to resolve module `@turf/bbox` from file `/Users/mac/code/my-app/node_modules/geojson-rbush/index.js`, the package `/Users/mac/code/my-app/node_modules/@turf/bbox/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/mac/code/my-app/node_modules/@turf/bbox/dist/cjs/index.cjs`. Indeed, none of these files exist:
@KanjiZain
Copy link

Same Issue Facing with Recent Verison of it :

project :app > project :rnmapbox_maps > Could not find com.mapbox.mapboxsdk:mapbox-sdk-turf:6.11.0.

@ahardy42
Copy link

I was also getting this error. i just installed @turf/bbox ^6.5.0 and it went away

@AzranAzwer
Copy link

@ahardy42 still facing an issue can you provide rnmapbox version too ?

@KanjiZain
Copy link

Yes same , I think can you provide Package. Json

@AzranAzwer
Copy link

this is one of the old project which needs map now.
"@turf/bbox": "^6.5.0",
"@rnmapbox/maps": "^10.1.33",
"react-native": "0.68.2",

@KanjiZain
Copy link

Yea i am also on same dependencies but it doesnt work

@ahardy42
Copy link

ahardy42 commented Dec 1, 2024

I am on the following

"react-native": "0.68.7",
"@rnmapbox/maps": "^10.1.33",
"@turf/bbox": "^6.5.0",
"@turf/turf": "^6.5.0",

For me the fix may actually be aligning the turf packages. I briefly consolidated all of my turf packages into one import of @turf/turf and that was v7.1.0. More recently I upgraded @rnmapbox/maps after upgrading to xcode 16 and getting a bitcode error (unrelated but still frustrating...). When I upgraded rnmapbox/maps to the 10.1.33 version I started getting this error related to geojson-rbush.

So, I was upgrading / downgrading all kinds of packages yesterday, and my memory is a bit murky on when, exactly, the error stopped happening but it is possible that it was actually after I installed the separate @turf/bbox package and then downgraded @turf/turf from 7.1.0 -> 6.5.0

hopefully this helps!

@AzranAzwer
Copy link

even after i added "@turf/bbox": "^6.5.0","@turf/turf": "^6.5.0", still facing the issue
may be I need to try with updating react native > 70+

@ansarikhurshid786
Copy link
Contributor

ansarikhurshid786 commented Dec 17, 2024

for me added below in metro.config.js

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
    }),
  },
  **resolver: {
    sourceExts: ['jsx', 'js', 'ts', 'tsx', 'cjs', 'mjs', 'json']
  }**
};


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants