Cannot open Hermes JS Debugger on adding metro-config package to address - "metro-file-map: Haste module naming collision" due to amplify/#current-cloud-backend having same files as amplify/backend. #1109
Do you want to request a feature or report a bug?
I want to report bug
What is the current behavior?
Describe the bug
Getting the below error on npx expo start. fixed using metro-config but js debugger is failing to launch after installing metro-config latest version(0.79.1)
metro-file-map: Haste module naming collision: wildAuthPostConfirmation
The following files share their name; please adjust your hasteImpl:
* <rootDir>/amplify/#current-cloud-backend/function/wildflowerAuthPostConfirmation/src/package.json
* <rootDir>/amplify/backend/function/wildflowerAuthPostConfirmation/src/package.json
Failed to construct transformer: DuplicateError: Duplicated files or mocks. Please check the console for more info
at setModule (/Users/tt/git-repos/wild1.0/node_modules/metro-file-map/src/index.js:450:17)
at workerReply (/Users/tt/git-repos/wild1.0/node_modules/metro-file-map/src/index.js:507:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 59371)
at async HasteMap._applyFileDelta (/Users/tt/git-repos/wild1.0/node_modules/metro-file-map/src/index.js:672:7)
at async /Users/tt/git-repos/wild1.0/node_modules/metro-file-map/src/index.js:327:9 {
mockPath1: 'amplify/#current-cloud-backend/function/wildAuthPostConfirmation/src/package.json',
mockPath2: 'amplify/backend/function/wildAuthPostConfirmation/src/package.json'
}
Error: Duplicated files or mocks. Please check the console for more info
at setModule (/Users/tt/git-repos/wild.0/node_modules/metro-file-map/src/index.js:450:17)
at workerReply (/Users/tt/git-repos/wild1.0/node_modules/metro-file-map/src/index.js:507:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 59371)
at async HasteMap._applyFileDelta (/Users/tt/git-repos/wildfirefly1.0/node_modules/metro-file-map/src/index.js:672:7)
at async /Users/tt/git-repos/wild1.0/node_modules/metro-file-map/src/index.js:327:9
So to fix it, adding metro-config(version 0.79.1) will fix the issue but will prevent Hermes JS Debugger from launching the debugger as there is nothing published in /json/list
Opening JavaScript inspector in the browser...
FetchError: invalid json response body at http://192.168.29.218:8081/json/list reason: Unexpected token < in JSON at position 0
FetchError: invalid json response body at http://192.168.29.218:8081/json/list reason: Unexpected token < in JSON at position 0
at /Users/tt/git-repo1/native/wildfirefly1.0/node_modules/node-fetch/lib/index.js:273:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.queryAllInspectorAppsAsync (/Users/tt/git-repo1/native/wild1.0/node_modules/@expo/dev-server/build/JsInspector.js:53:30)
at async DevServerManagerActions.openJsInspectorAsync (/Users/tt/git-repo1/native/wild1.0/node_modules/@expo/cli/build/src/start/interface/interactiveActions.js:94:22)
at async KeyPressHandler.handleKeypress (/Users/tt/git-repo1/native/wild1.0/node_modules/@expo/cli/build/src/start/interface/KeyPressHandler.js:43:17)
Below is what is returned when amplify is NOT used the /json/list returns the list of debuggable apps
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
Reproduction steps
Create a react native app using yarn create expo-app AwesomeProject
Create an amplify project. Add some resources
Start the expo app npx expo start
It will give an error - metro-file-map: Haste module naming collision: wildAuthPostConfirmation as mentioned above.
Fix by installing metro-config package version(0.79.1 latest) This will fix the above error(Haste module naming collision)
Now start the expo app again and try to launch the JS debugger it will give an error - FetchError: invalid json response body at http://192.168.29.218:8081/json/list reason: Unexpected token < in JSON at position 0
What is the expected behavior?
Should ignore the amplify/#current-cloud-backend and js debugger should get launched
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version, and operating system.
Do you want to request a feature or report a bug? I want to report bug
What is the current behavior?
Describe the bug
Getting the below error on npx expo start. fixed using metro-config but js debugger is failing to launch after installing metro-config latest version(0.79.1)
So to fix it, adding metro-config(version 0.79.1) will fix the issue but will prevent Hermes JS Debugger from launching the debugger as there is nothing published in /json/list
Below is what is returned when amplify is NOT used the /json/list returns the list of debuggable apps
Working - http://192.168.29.8:8081/json/list
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.Reproduction steps
What is the expected behavior? Should ignore the amplify/#current-cloud-backend and js debugger should get launched
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version, and operating system.