-
Notifications
You must be signed in to change notification settings - Fork 672
Description
https://metrobundler.dev/docs/configuration/#hasteimplmodulepath documents how to map files for the haste opt-in mechanism. The default config for React Native seems to enable this for any file, like import Foo from 'Foo'
Since Jest does not support this, we want to turn this feature off, so we don't end up with imports that are only valid in metro, but not in jest.
Following the docs, this seems like the right implementation for that:
module.exports = {
getHasteName() {
return null;
},
};With hasteImplModulePath: './nullHasteImpl.js', in our metro.config.js.
Yet when starting metro, we always get this error:
metro-file-map: Expected `./nullHasteImpl.js` to export `getCacheKey: () => string`
I tried to implement variations of getCacheKey as a separate export or a return value inside of getHastName, but nothing makes a difference.
Are we doing it wrong? Or is this a bug in the hasteImplModulePath implementation? Or in the documentation?