Error: Unable to find file with empty: prelude_dev.js

I get the following error when running the package:

Error: Unable to find file with path: /Users/erem/thrivespace/react-mobile/node_modules/react-native/packager/react-packager/src/Resolver/polyfills/prelude_dev.js
    at Fastfs.readFile (/Users/erem/thrivespace/react-mobile/node_modules/node-haste/lib/fastfs.js:141:15)
    at /Users/erem/thrivespace/react-mobile/node_modules/node-haste/lib/Module.js:168:49
    at Cache.get (/Users/erem/thrivespace/react-mobile/node_modules/node-haste/lib/Cache/index.js:64:103)
    at Polyfill.read (/Users/erem/thrivespace/react-mobile/node_modules/node-haste/lib/Module.js:167:26)
    at Bundler._toModuleTransport (index.js:524:14)
    at toModuleTransport (index.js:400:14)
    at Array.map (native)
    at index.js:416:48
    at tryCallOne (/Users/erem/thrivespace/react-mobile/node_modules/promise/lib/core.js:37:12)
    at /Users/erem/thrivespace/react-mobile/node_modules/promise/lib/core.js:123:15

I already ran:

rm -rf node_modules
npm cache clean
npm install

I am currently running React Native 0.24.0.

+4
source share
2 answers

This is a cache problem. See: https://github.com/facebook/react-native/issues/1924

You need to clear the packer cache:

rm -fr $TMPDIR/react-*

Or this seems to do the trick too:

watchman watch-del-all

+2
source

If you use your own rn-cli.config.js, try without it.

I spent many hours on this with the bad rn-cli.config.js file. He worked for a while until he did.


In my case, I used this:

var blacklist = require('react-native/packager/blacklist');
var config = {
    getBlacklistRE(platform) {
        return blacklist(platform, [
            /src/
        ]);
    }
};
module.exports = config;

when I should have used this instead:

var blacklist = require('react-native/packager/blacklist');
var config = require('react-native/packager/rn-cli.config');
config.getBlacklistRE = function(platform) {
    return blacklist(platform, [
        /src/
    ]);
};
module.exports = config;
+1
source

All Articles