Closed dnsmob closed 5 years ago
Thanks! Any idea which changes are needed for the new Metro version?
With Metro 0.51.1 it borks when trying to access this
UnhandledPromiseRejectionWarning: Error: Cannot find module 'metro/src/reactNativeTransformer'
So the error happens because the transformer path has changed in the newest Metro version and is going to be like that in React Native 0.59.
I released a new version (v.1.3.2) of this transformer that uses the new path for React Native 0.59.
If you want to use a custom version with Metro for your current project, then I recommend using Metro v0.49.2 for now and updating that to 0.51.1 when updating to use React Native 0.59.
Oh yeah and thanks a lot for notifying me about this! :)
@kristerkari In my case I had to change const transformer = require('metro/src/reactNativeTransformer');
to const transformer = require('metro-babel-transformer');
, as they've put the transformer into a separate module.
@palexs yeah, that's what the latest version the Sass transformer is also doing: https://github.com/kristerkari/react-native-sass-transformer/blob/master/index.js#L13-L14
This is more of a heads up rather than an issue. This lib works fine if I create a project via
react-native
command, but if I manually install the metro bundler (vianpm i metro
), the latest/current version does not match the file dependencies, and it then breaks this transformer. Obvious fix is to just install the exact version, but at some point RN will be using the latest Metro too.RN cli uses metro 0.49.2 npm i will install metro 0.51.1