Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Couldn't find entry file index.js in any of the roots" error occurred during debugging #674

Closed
ruslan-bikkinin opened this issue Mar 29, 2018 · 4 comments

Comments

@ruslan-bikkinin
Copy link
Contributor

ruslan-bikkinin commented Mar 29, 2018

Summary

One of our users experiencing problem when he tries to debug his application and even simple React Native project generated by react-native init command. Error occur during the initialization phase of debug session and then debugging stops.

This error appears either on simulator and physical android device.

However, Attach to debugger command works as expected without any problems.

Reproduction steps

  1. Generate empty RN project via react-native init.
  2. Create .vscode/launch.json file with this configuration:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Android",
            "program": "${workspaceRoot}/.vscode/launchReactNative.js",
            "type": "reactnative",
            "request": "launch",
            "platform": "android",
            "sourceMaps": true,
            "outDir": "${workspaceRoot}/.vscode/.react",
            "trace": "verbose"
        },
    ]
}
  1. Start debugging (Debug->play icon).

Expected Behavior

  1. Debugger is working, no errors occur or weird events during the process.

Actual Behavior

  1. Application installs on device/simulator, then Connecting to remote debugger message shows up.
  2. After a few seconds application crashes and immediately re-opens.
  3. Debug session in VS Code interrupts, following error message is prompted to the Debug Console:
Couldn't import script at <http://localhost:8081/index.bundle?platform=android&dev=true&minify=false>. Debugging won't work: Try reloading the JS from inside the app, or Reconnect the VS Code debugger: {"message":"Cannot find entry file index.js in any of the roots: [\"c:\\\\Users\\\\user1\\\\Desktop\\\\temp\\\\RegTemplate\"]", ...

Software versions

  • React-Native VS Code extension version: 0.6.6
  • VSCode version: 1.21.1
  • OS platform and version: Windows 10 Enterprise
  • NodeJS version: 9.5.0, 8.11.0 (can be reproduced on both)
  • React Native version: 0.53.3

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
Click
OS: win32 x64
Adapter node: v7.9.0 x64
vscode-chrome-debug-core: 3.23.0
12:54:51 PM, 3/28/2018
From client: initialize({"clientID":"vscode","adapterID":"reactnative","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":false}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsDelayedStackTraceLoading":true,"supportsValueFormattingOptions":true}}
Starting debugger app worker.
About to download: http://localhost:8081/debugger-ui/debuggerWorker.js to: C:\Users\user1\Desktop\temp\RegTemplate\.vscode\.react\debuggerWorker.js
Established a connection with the Proxy (Packager) to the React Native application
From RN APP: {"method":"$disconnected"}
From RN APP: {"id":0,"method":"prepareJSRuntime"}
A new app worker lifetime was created.
Spawned debuggee process with pid 24320 listening to 3267
Debugger worker loaded runtime on port 3267
From client: attach({"name":"Debug Android","program":"C:\\Users\\user1\\Desktop\\temp\\RegTemplate/.vscode/launchReactNative.js","type":"reactnative","request":"attach","platform":"android","sourceMaps":true,"outDir":"C:\\Users\\user1\\Desktop\\temp\\RegTemplate/.vscode/.react","trace":"verbose","__sessionId":"25b29506-1d27-4686-806f-46024db96d02","port":3267,"address":"localhost","restart":true})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStarted","data":{"request":"attach","args":["name","program","type","request","platform","sourceMaps","outDir","trace","__sessionId","port","address","restart","remoteRoot","localRoot","sourceMapPathOverrides","showAsyncStacks"]}}}
To RN APP: {"replyID":0}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetCount","data":{"numTargets":1}}}
To client: {"seq":0,"type":"response","request_seq":2,"command":"attach","success":true,"body":{"supportsStepBack":false}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"nodeVersion","data":{"version":"v8.11.0"}}}
To client: {"seq":0,"type":"event","event":"initialized"}
From client: setExceptionBreakpoints({"filters":[]})
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"bootstrap_node.js","path":"<node_internals>/bootstrap_node.js","sourceReference":1000,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"events.js","path":"<node_internals>/events.js","sourceReference":1001,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"util.js","path":"<node_internals>/util.js","sourceReference":1002,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"errors.js","path":"<node_internals>/internal/errors.js","sourceReference":1003,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"encoding.js","path":"<node_internals>/internal/encoding.js","sourceReference":1004,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"util.js","path":"<node_internals>/internal/util.js","sourceReference":1005,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"VM26","path":"<eval>/VM26","sourceReference":1006,"origin":"read-only content from Node.js"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"types.js","path":"<node_internals>/internal/util/types.js","sourceReference":1007,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"buffer.js","path":"<node_internals>/buffer.js","sourceReference":1008,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"buffer.js","path":"<node_internals>/internal/buffer.js","sourceReference":1009,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"process.js","path":"<node_internals>/internal/process.js","sourceReference":1010,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"warning.js","path":"<node_internals>/internal/process/warning.js","sourceReference":1011,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"next_tick.js","path":"<node_internals>/internal/process/next_tick.js","sourceReference":1012,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"async_hooks.js","path":"<node_internals>/internal/async_hooks.js","sourceReference":1013,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"promises.js","path":"<node_internals>/internal/process/promises.js","sourceReference":1014,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"stdio.js","path":"<node_internals>/internal/process/stdio.js","sourceReference":1015,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"perf_hooks.js","path":"<node_internals>/perf_hooks.js","sourceReference":1016,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"linkedlist.js","path":"<node_internals>/internal/linkedlist.js","sourceReference":1017,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"trace_events_async_hooks.js","path":"<node_internals>/internal/trace_events_async_hooks.js","sourceReference":1018,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"async_hooks.js","path":"<node_internals>/async_hooks.js","sourceReference":1019,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"inspector_async_hook.js","path":"<node_internals>/internal/inspector_async_hook.js","sourceReference":1020,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"child_process.js","path":"<node_internals>/child_process.js","sourceReference":1021,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"child_process.js","path":"<node_internals>/internal/child_process.js","sourceReference":1022,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"string_decoder.js","path":"<node_internals>/string_decoder.js","sourceReference":1023,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"net.js","path":"<node_internals>/net.js","sourceReference":1024,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"stream.js","path":"<node_internals>/stream.js","sourceReference":1025,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"legacy.js","path":"<node_internals>/internal/streams/legacy.js","sourceReference":1026,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_readable.js","path":"<node_internals>/_stream_readable.js","sourceReference":1027,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"BufferList.js","path":"<node_internals>/internal/streams/BufferList.js","sourceReference":1028,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"destroy.js","path":"<node_internals>/internal/streams/destroy.js","sourceReference":1029,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_writable.js","path":"<node_internals>/_stream_writable.js","sourceReference":1030,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_duplex.js","path":"<node_internals>/_stream_duplex.js","sourceReference":1031,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_transform.js","path":"<node_internals>/_stream_transform.js","sourceReference":1032,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_passthrough.js","path":"<node_internals>/_stream_passthrough.js","sourceReference":1033,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"timers.js","path":"<node_internals>/timers.js","sourceReference":1034,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"assert.js","path":"<node_internals>/assert.js","sourceReference":1035,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"net.js","path":"<node_internals>/internal/net.js","sourceReference":1036,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"dns.js","path":"<node_internals>/dns.js","sourceReference":1037,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"dgram.js","path":"<node_internals>/dgram.js","sourceReference":1038,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"socket_list.js","path":"<node_internals>/internal/socket_list.js","sourceReference":1039,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"module.js","path":"<node_internals>/module.js","sourceReference":1040,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"module.js","path":"<node_internals>/internal/module.js","sourceReference":1041,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"url.js","path":"<node_internals>/internal/url.js","sourceReference":1042,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"querystring.js","path":"<node_internals>/internal/querystring.js","sourceReference":1043,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"querystring.js","path":"<node_internals>/querystring.js","sourceReference":1044,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"vm.js","path":"<node_internals>/vm.js","sourceReference":1045,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"fs.js","path":"<node_internals>/fs.js","sourceReference":1046,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"path.js","path":"<node_internals>/path.js","sourceReference":1047,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"fs.js","path":"<node_internals>/internal/fs.js","sourceReference":1048,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"Loader.js","path":"<node_internals>/internal/loader/Loader.js","sourceReference":1049,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"ModuleWrap.js","path":"<node_internals>/internal/loader/ModuleWrap.js","sourceReference":1050,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"ModuleMap.js","path":"<node_internals>/internal/loader/ModuleMap.js","sourceReference":1051,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"ModuleJob.js","path":"<node_internals>/internal/loader/ModuleJob.js","sourceReference":1052,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"safe_globals.js","path":"<node_internals>/internal/safe_globals.js","sourceReference":1053,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"ModuleRequest.js","path":"<node_internals>/internal/loader/ModuleRequest.js","sourceReference":1054,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"url.js","path":"<node_internals>/url.js","sourceReference":1055,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"search.js","path":"<node_internals>/internal/loader/search.js","sourceReference":1056,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"console.js","path":"<node_internals>/console.js","sourceReference":1057,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"debuggerWorker.js","path":"c:\\Users\\user1\\Desktop\\temp\\RegTemplate\\.vscode\\.react\\debuggerWorker.js","origin":"read-only content from Node.js"}}}
To client: {"seq":0,"type":"response","request_seq":3,"command":"setExceptionBreakpoints","success":true}
From RN APP: {"id":1,"method":"executeApplicationScript","url":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","inject":{"__fbBatchedBridgeConfig":"{\"remoteModuleConfig\":[[\"PlatformConstants\",{\"Fingerprint\":\"motorola/otus_retuaws/otus:5.1/LPCS23.13-56-5/5:user/release-keys\",\"Version\":22,\"Serial\":\"TA10701Y90\",\"isTesting\":false,\"ServerHost\":\"localhost:8081\",\"Release\":\"5.1\",\"reactNativeVersion\":{\"patch\":3,\"prerelease\":null,\"minor\":54,\"major\":0},\"Model\":\"MotoE2\"}],[\"LocationObserver\",{},[\"getCurrentPosition\",\"startObserving\",\"stopObserving\"]],[\"IntentAndroid\",{},[\"canOpenURL\",\"getInitialURL\",\"openURL\"],[0,1,2]],[\"Vibration\",{},[\"cancel\",\"vibrate\",\"vibrateByPattern\"]],[\"FileReaderModule\",{},[\"readAsDataURL\",\"readAsText\"],[0,1]],[\"CameraRollManager\",{},[\"getPhotos\",\"saveToCameraRoll\"],[0,1]],[\"Timing\",{},[\"createTimer\",\"deleteTimer\",\"setSendIdleEvents\"]],[\"JSCSamplingProfiler\",{},[\"operationComplete\"]],[\"TimePickerAndroid\",{},[\"open\"],[0]],[\"I18nManager\",{\"doLeftAndRightSwapInRTL\":true,\"localeIdentifier\":\"en_GB\",\"isRTL\":false},[\"allowRTL\",\"forceRTL\",\"swapLeftAndRightInRTL\"]],[\"ExceptionsManager\",{},[\"dismissRedbox\",\"reportFatalException\",\"reportSoftException\",\"updateExceptionMessage\"]],[\"AsyncSQLiteDBStorage\",{},[\"clear\",\"getAllKeys\",\"multiGet\",\"multiMerge\",\"multiRemove\",\"multiSet\"]],[\"Networking\",{},[\"abortRequest\",\"clea[...]
From client: configurationDone(undefined)
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":4,"command":"configurationDone","success":true}
To client: {"seq":0,"type":"response","request_seq":5,"command":"threads","success":true,"body":{"threads":[{"id":1,"name":"Node (24320)"}]}}
Packager requested runtime to load script from http://localhost:8081/index.bundle?platform=android&dev=true&minify=false
Couldn't import script at <http://localhost:8081/index.bundle?platform=android&dev=true&minify=false>. Debugging won't work: Try reloading the JS from inside the app, or Reconnect the VS Code debugger: {"message":"Cannot find entry file index.js in any of the roots: [\"c:\\\\Users\\\\user1\\\\Desktop\\\\temp\\\\RegTemplate\"]","name":"NotFoundError","type":"NotFoundError","status":404,"errors":[{"description":"Cannot find entry file index.js in any of the roots: [\"c:\\\\Users\\\\user1\\\\Desktop\\\\temp\\\\RegTemplate\"]"}],"stack":"NotFoundError: Cannot find entry file index.js in any of the roots: [\"c:\\\\Users\\\\user1\\\\Desktop\\\\temp\\\\RegTemplate\"]\n    at DependencyGraph.getAbsolutePath (c:\\Users\\user1\\Desktop\\temp\\RegTemplate\\node_modules\\metro\\src\\node-haste\\DependencyGraph.js:316:11)\n    at c:\\Users\\user1\\Desktop\\temp\\RegTemplate\\node_modules\\metro\\src\\DeltaBundler\\DeltaCalculator.js:280:416\n    at Generator.next (<anonymous>)\n    at step (c:\\Users\\user1\\Desktop\\temp\\RegTemplate\\node_modules\\metro\\src\\DeltaBundler\\DeltaCalculator.js:11:445)\n    at c:\\Users\\user1\\Desktop\\temp\\RegTemplate\\node_modules\\metro\\src\\DeltaBundler\\DeltaCalculator.js:11:605\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)"}
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
[Extension Host] (node:9766) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
t.log @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:257
@ruslan-bikkinin ruslan-bikkinin changed the title "Couldn't find entry file index.js in any of the roots" error during debug "Couldn't find entry file index.js in any of the roots" error occurred during debugging Mar 29, 2018
@itoys
Copy link
Contributor

itoys commented May 15, 2018

Related to this issue facebook/react-native#14246

@itoys itoys closed this as completed May 15, 2018
@itoys itoys added external and removed bug labels May 15, 2018
@allforabit
Copy link

Could this issue be reopened as I'm getting the exact same error on Windows 10. I don't get it when using react native directly, only when using VSCode. The issue seems to be related to the command that runs react-native start. If I run that manually and then run debugging or attach tasks everything works as expected.

@itoys
Copy link
Contributor

itoys commented Jun 15, 2018

Hi @allforabit,
It would be better to open a new issue. Please fill it by tempalate.

Thanks!

@allforabit
Copy link

OK thanks will do @itoys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants