Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

However, this package itself specifies a `main` module field that could not be resolved - React Native

$
0
0

I have installed the 'react-native-auto-scrolling` package and I get the following error:

error: Metro has encountered an error: While trying to resolve module 'react-native-auto-scrolling' from file '.....\Home.js', the package '......\node_modules\react-native-auto-scrollinge\package.json' was successfully found. However, this package itself specifies a 'main' module field that could not be resolved ('......\node_modules\react-native-auto-scrollinge\dist\index.js'.

I have tried to fix this by adding in the metro.config.js the following code:

resolver: {         sourceExts: ['jsx', 'js', 'ts', 'tsx'],},

under module.exports (as I found that the Metro doesn't know how to compile by default .tsx) but I still cannot use the package, as it returns me the same error when trying to run react-native run-android. As I checked node-modules for the package, I have discovered that the package is created using typescript.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>