geodesy icon indicating copy to clipboard operation
geodesy copied to clipboard

Can't resolve module for react-native Android app

Open DiefBell opened this issue 6 years ago • 4 comments

We're using Geodesy in a React-Native Android app and are trying to upgrade from 1.1.3 to 2.2.0, however when trying to build and run we get the following error:

While trying to resolve module geodesy from file redux\NMEA.js, the package node_modules\geodesy\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (\node_modules\geodesy\index). Indeed, none of these files exist:

  • node_modules\geodesy\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)
  • node_modules\geodesy\index\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)

We've got esm installed and updated to Geodesy 2.2.0 with the npm command from the readme. React-native is version 0.52.1.

Any help on this would be massively appreciated, thanks :)

DiefBell avatar Sep 17 '19 13:09 DiefBell

I'm afraid I'm neither a React user nor an Android developer.

That message seems quite strange: package.json doesn't specify any main file, as the library has no single entry point – is React Native (or Redux) somehow injecting a main field, or something?

Unless you require functionality not available in 1.1.3, the simplest might be to stick with that!

chrisveness avatar Sep 17 '19 14:09 chrisveness

Unfortunately we need the functionality for forcing UTM zones. I'll keep looking around and try to work out the issue

DiefBell avatar Sep 17 '19 14:09 DiefBell

It might be worth reaching out on Reactiflux if you haven't already. Or possibly redux.

Failing anything else, I might be able to backport the UTM zone override to a v1.1.4, but I'd sooner not revisit version 1!

chrisveness avatar Sep 17 '19 15:09 chrisveness

Our app currently uses DenisCarriere's TypeScript definitions from a few years back so I suspect that that's what's causing the issue. I've reached out to him in his original ticket from 2016, but if not a backport would be massively appreciated!

DiefBell avatar Sep 17 '19 15:09 DiefBell