flat-list-mvcp: Cannot find module

I am sorry if that seems like a silly thing to ask, but I have tried all sorts of things to make the import work with no success:

Cannot find module '@stream-io/flat-list-mvcp' or its corresponding type declarations. ts(2307)

I inspected the node_modules/@stream-io/flat-list-mvcp and all the files are there. I realized they are using a index.ios.tsx and index.android.tsx. Do I need any special configurations in my RN project to make it able to read those? I am currently using react-native: 0.63.3. Thank you!

Screen Shot 2021-02-19 at 5 40 17 PM

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21

Most upvoted comments

i’m still facing this issues, any ideas?

@Maxim-Filimonov you suggestion worked to resolve my import issues when running jest. I did not run into the new error you mentioned so that may be caused by another issue unrelated to the import itself.

@Surinder1922 & @roryabraham do you have javascript only project? I have JS non TS project and facing the same issue with jest.

I have a feeling it has something to do with missing index.js file.

cat node_modules/@stream-io/flat-list-mvcp/package.json| grep main “description”: “maintainVisibleContentPosition support for Android react-native”, “main”: “lib/commonjs/index”, ls node_modules/@stream-io/flat-list-mvcp/lib/commonjs FlatList.android.js FlatList.js ScrollView.android.js ScrollView.js index.js.map useMvcpTuner.js.map FlatList.android.js.map FlatList.js.map ScrollView.android.js.map ScrollView.js.map useMvcpTuner.js

EDIT: After fiddling with the package found that build script has this line for some reason: rm lib/commonjs/index.js After removing it and running build again managed to run jest without this issue. Though a new one appears:

Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules

  at invariant (node_modules/@stream-io/flat-list-mvcp/node_modules/invariant/invariant.js:40:15)
  at Object.<anonymous> (node_modules/@stream-io/flat-list-mvcp/node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:169:3)
  at Object.<anonymous> (node_modules/@stream-io/flat-list-mvcp/node_modules/react-native/Libraries/TurboModule/TurboModuleRegistry.js:13:23)

Let me take a look and get back 😃

@rgbedin fixed in v0.0.6