node-cbor: cbor fails to import in expo/metro bundle (expo go IOS)
I’m developing a React Native application and I cannot get this library to work under expo/metro. Simply adding import cbor from 'cbor'; causes the bundle to error out with Unhandled JS Exception: Invalid regular expression: invalid group specifier name no stack.
To reproduce:
expo init dummy # minimal template
cd dummy
npm install cbor
npm install node-inspect-extracted
npm install stream
# Add "import cbor from 'cbor';" to App.js
expo start
# open bundle with expo go
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (14 by maintainers)
Understanding their code let me simplify a few things. Current set of packages required:
No changes to
babel.config.jsnecessary. Changemetro.config.jsto: