TVke/react-native-tailwindcss

Direct dependency of `react-native` causing build conflicts

Closed this issue · 2 comments

Hi @TVke --

I've been having some difficulty with version 1.1.7, on various RN projects.
commit 98ecbb7 introduced a direct dependency on react-native >= 0.61.5.

With older RN (I tested 0.59.10), I get a metro bundler conflict, complaining about 2 versions of RN and displaying the node_modules/react-native-tailwindcss/node_modules/react-native nested dependency directory.

Also, with RN 0.61.5, I'm seeing another issue when running hook tests using the testing-library:

  ● Test suite failed to run

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

      at invariant (node_modules/invariant/invariant.js:40:15)
      at Object.invariant (node_modules/react-native-tailwindcss/node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:166:3)
      at Object.require (node_modules/react-native-tailwindcss/node_modules/react-native/Libraries/TurboModule/TurboModuleRegistry.js:13:23)

It looks like react-native is only used in the tests, so we can probably put it back in peerDependencies, but then also add it to devDependencies for the test code. Could be missing something though.

I'll add a PR here in a minute.

Thanks!

Added PR. react is only used in the tests (so devDep only), while react-native is used in sourcecode (so devDep+peerDep).

TVke commented

Hi @davidgovea
Thank you for the help I forgot to check older versions indeed.