metro: Metro has encountered an error: Cannot read properties of undefined (reading 'transformFie'): . . .
Error while running react-native app on ios.
react-native version: 0.67.3
Metro has encountered an error: Cannot read properties of undefined (reading ‘transformFie’): . . .
Tried changing node version to 17, 16.12, 14, etc. but no use.
Please help / guide. Thanks.

detailed error:
Metro has encountered an error: Cannot read properties of undefined (reading 'transformFile'): node_modules/metro/src/Bundler.js (48:30)
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 9
- Comments: 24 (3 by maintainers)
@NaveenSubburaj no, i have abandoned react native due to bugs like these & lack of support and planning to move to native or flutter, lets see.
This work for me
export NODE_OPTIONS=--openssl-legacy-providerand i’m not downgrade my node
my node
17.7.1i’m just install same node from
package.json => dependencies => nodeon folder project react-nativeStill facing this issue, reopen this
how did that go? moving to flutter or native because you cant setup your environment, good luck
Yes, this is down to incompatibility of older versions of Metro with Node 17+. Contrary to the original issue report here, I haven’t seen a reproduction for Node <17. The root cause is Node 17 using OpenSSL 3 (https://github.com/nodejs/node/issues/40455), which drops support for MD4 hashing, which we used until #752.
Three options:
NODE_OPTIONS=--openssl-legacy-providerStill getting the error with React Native 0.71 on Node 18
EDIT: Weird, my metro is still .66 even on RN .71. Will look into.
I solved this by switching to node v16.
Hi! I solved this issue with downgrading node version. (In my case, v17.4.0 -> v16.13.0)
@rh389
package-lock.json: https://gist.github.com/nabtron/3ab61e930e3ad997deaa54e294c3e154
Same issue here.