copleykj / react-native-meteor

Full Meteor client with Tracker integration for React and React Native
https://www.npmjs.com/package/@socialize/react-native-meteor
MIT License
11 stars 5 forks source link

Can't resolve 'react-native' | for web app project #3

Closed barrymichaeldoyle closed 4 years ago

barrymichaeldoyle commented 4 years ago

I'm experience the following issue when I import Meteor from '@socialize/react-native-meteor'

Module not found: Can't resolve 'react-native' in '...\node_modules\@react-native-community\netinfo\lib\module\internal'

This is for use with a web app. So I shouldn't need to install the RN plugins if I recall the docs correctly.

copleykj commented 4 years ago

You are correct! It's very odd that this code path could execute. Could you outline your build setup, or if possible, provide a very minimal reproduction where the build fails with this error.

copleykj commented 4 years ago

@barrymichaeldoyle can you elaborate on which bundler you are using for your project?

gamedolphin commented 4 years ago

This happens when using this library with create-react-app as well.

copleykj commented 4 years ago

Ok, so it turns out that while node, meteor, and metro all support conditionally requiring modules, not all bundlers (webpack in particular) do. I think we can work around this with a bit of dependency injection and I'll see about getting a new release out very soon.

copleykj commented 4 years ago

All fixed in the freshly published v3.0.0