Reputation: 131
This is my first time using sanity and I have encounter with this problem, When running expo start
, I will be very thankful if you can help me with this
jest-haste-map: Haste module naming collision: deliveroo-clone
The following files share their name; please adjust your hasteImpl:
* <rootDir>\package.json
* <rootDir>\sanity\package.json
Failed to construct transformer: DuplicateError: Duplicated files or mocks. Please check the
console for more info
at setModule (C:\Users\Slima\Desktop\deliveroo-clone\node_modules\jest-haste-
map\build\index.js:576:17)
at workerReply (C:\Users\Slima\Desktop\deliveroo-clone\node_modules\jest-haste-
map\build\index.js:647:9)
at async Promise.all (index 10)
at C:\Users\Slima\Desktop\deliveroo-clone\node_modules\jest-haste-map\build\index.js:459:22
at Function.load (C:\Users\Slima\Desktop\deliveroo-clone\node_modules\metro\src\node-
haste\DependencyGraph.js:86:36)
at Bundler.ready (C:\Users\Slima\Desktop\deliveroo-
clone\node_modules\metro\src\Bundler.js:61:5)
at IncrementalBundler.ready (C:\Users\Slima\Desktop\deliveroo-
clone\node_modules\metro\src\IncrementalBundler.js:309:5)
at Server.ready (C:\Users\Slima\Desktop\deliveroo-
clone\node_modules\metro\src\Server.js:1156:5) {
mockPath1: 'package.json',
mockPath2: 'sanity\\package.json'
}`
Unrecognized event: {"type":"transformer_load_failed","error":
{"mockPath1":"package.json","mockPath2":"sanity\package.json","name":"Error","message":"Duplicate
d files or mocks. Please check the console for more info","stack":"Error: Duplicated files or
mocks. Please check the console for more info\n at
setModule (C:\Users\Slima\Desktop\deliveroo-clone\node_modules\jest-haste-
map\build\index.js:576:17)\n at workerReply (C:\Users\Slima\Desktop\deliveroo-
clone\node_modules\jest-haste-map\build\index.js:647:9)\n at async Promise.all (index
10)\n at C:\Users\Slima\Desktop\deliveroo-clone\node_modules\jest-haste-
map\build\index.js:459:22\n at Function.load (C:\Users\Slima\Desktop\deliveroo-
clone\node_modules\metro\src\node-haste\DependencyGraph.js:86:36)\n at Bundler.ready
(C:\Users\Slima\Desktop\deliveroo-clone\node_modules\metro\src\Bundler.js:61:5)\n
at IncrementalBundler.ready (C:\Users\Slima\Desktop\deliveroo-
clone\node_modules\metro\src\IncrementalBundler.js:309:5)\n at Server.ready
(C:\Users\Slima\Desktop\deliveroo-clone\node_modules\metro\src\Server.js:1156:5)"}}
`
Upvotes: 8
Views: 6489
Reputation: 71
Go to package.json
inside the sanity folder and change the value for the name, then save and reload the app.
Just like this, change what you have as the value of name:
{
"name": "foodr-app*-sanity*",
"private": true,
"version": "1.0.0",
"description": "",
"main": "package.json",
"author": "<@gmail.com>",
"license": "UNLICENSED",
}
Upvotes: 7
Reputation: 1
This older post worked for me. It's just a matter of giving a different "name" for one of the package.json files. The two different package.json files with the same value for the name property is the issue. React Native DuplicateError: Duplicated files or mocks
Upvotes: 0
Reputation: 19
{ "name": use_different_name, "private": true, "version": "1.0.0",
Upvotes: 1
Reputation: 46
I had the same problem with a React-native and Sanity project.
The only solution I find was create folders "server" and "client". Drag all sanity folder/files to the "server" folder and all the other files into the "client" folder.
Note: just cd
into "client" folder to run the react-native project and cd to "server" folder to run sanity start
.
Upvotes: 3