gregberge/twc

Metro encountered an error while trying to resolve react-twc

overra opened this issue ยท 1 comments

overra commented

๐Ÿ› Bug Report

I ran into this issue when trying to use react-twc in an Expo app. I've temporarily copied the component into my project as a workaround. Seems we need either index.js to export dist/index or point "main" in package.json to dist/index.

image

To Reproduce

Use react-twc in an Expo project. My particular project is based off t3 turbo.

Expected behavior

It should work

## System:
 - OS: macOS 14.0
 - CPU: (12) arm64 Apple M2 Pro
 - Memory: 65.58 MB / 32.00 GB
 - Shell: 5.9 - /bin/zsh
## Binaries:
 - Node: 20.10.0 - ~/.volta/tools/image/node/20.10.0/bin/node
 - Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
 - npm: 10.2.3 - ~/.volta/tools/image/node/20.10.0/bin/npm
 - pnpm: 8.6.3 - ~/.volta/tools/image/pnpm/8.6.3/bin/pnpm
 - bun: 1.0.25 - ~/.bun/bin/bun

Hello @overra, twc is an ESM only module and will remain like that. The problem is expo that does not support ESM. I don't really know expo, maybe you have to upgrade it or it simply does not work. I suggest to copy the code of twc in your project.