mirror of https://github.com/status-im/metro.git
metro-bundler: ModuleGraph: fix in-memory node-haste impl error
Reviewed By: cpojer Differential Revision: D6323532 fbshipit-source-id: 067be85171d8d8839c977bd2aa7fdc7efc178f0a
This commit is contained in:
parent
b75f385524
commit
56e790f958
|
@ -91,11 +91,12 @@ const createModuleMap = ({files, helpers, moduleCache, sourceExts}) => {
|
||||||
// 0 = Module, 1 = Package in jest-haste-map
|
// 0 = Module, 1 = Package in jest-haste-map
|
||||||
map[id][platform] = [filePath, module.type === 'Package' ? 1 : 0];
|
map[id][platform] = [filePath, module.type === 'Package' ? 1 : 0];
|
||||||
|
|
||||||
if (existingModule && existingModule.path !== filePath) {
|
if (existingModule && existingModule[0] !== filePath) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`@providesModule naming collision:\n` +
|
`@providesModule naming collision:\n` +
|
||||||
` Duplicate module name: ${id}\n` +
|
` Duplicate module name: \`${id}\`\n` +
|
||||||
` Paths: ${filePath} collides with ${existingModule.path}\n\n` +
|
` Paths: \`${filePath}\` collides with ` +
|
||||||
|
`\`${existingModule[0]}\`\n\n` +
|
||||||
'This error is caused by a @providesModule declaration ' +
|
'This error is caused by a @providesModule declaration ' +
|
||||||
'with the same name across two different files.',
|
'with the same name across two different files.',
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue