Search code examples
javascriptiosreactjsreact-nativemetro-bundler

React Native Error Cannot find module 'metro-config/src/defaults/blacklist'


I'm currently working on a project in React Native, yesterday it was working perfectly with no errors, and now all of a sudden I'm getting this error.

error Cannot find module 'metro-config/src/defaults/blacklist'
Require stack:
- /Users/sri/Downloads/cc_x/reactnativelcsapp/VitalitiApp/metro.config.js

I've tried soo many solutions, removing the node modules and installing it back, updating the modules, looking to change the backlist. I've checked my files and I can't find the blacklist file but I'm trying to fix it but honestly have no idea how to fix it. I was wondering if anyone would know what to do.


Solution

  • the blacklist file seems to be renamed as exclusionList

    const blacklist = require('metro-config/src/defaults/exclusionList');
    

    use this line instead in metro.config.js