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

App Crashing on Debug #198

Closed
pranshuchittora opened this issue Mar 21, 2021 · 5 comments
Closed

App Crashing on Debug #198

pranshuchittora opened this issue Mar 21, 2021 · 5 comments

Comments

@pranshuchittora
Copy link

Observed results

App crashing of hitting debug

Logs

Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:592:3)
    at tryReadSync (fs.js:366:20)
    at Object.readFileSync (fs.js:403:19)
    at UnableToResolveError.buildCodeFrameMessage (/home/undefined/work/round2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:347:17)
    at new UnableToResolveError (/home/undefined/work/round2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:333:35)
    at ModuleResolver.resolveDependency (/home/undefined/work/round2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15)
    at DependencyGraph.resolveDependency (/home/undefined/work/round2/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
    at /home/undefined/work/round2/node_modules/metro/src/lib/transformHelpers.js:317:42
    at /home/undefined/work/round2/node_modules/metro/src/Server.js:1471:14
    at Generator.next (<anonymous>)

Please add the log output here.

Steps to reproduce

  1. Open in Android
  2. Hit debug
@radko93
Copy link
Collaborator

radko93 commented Mar 22, 2021

Hi, can you try if this also happens without the typescript template?

@dgellow
Copy link

dgellow commented Mar 22, 2021

I can confirm that I'm facing the same error. I created a new react native project using the template react-native-template-typescript and get this error Error: EISDIR: illegal operation on a directory, read after bundling the app.

So far I haven't been able to figure out which directory/file it is trying to read.

Edit: I believe that the error looks weird due to facebook/metro#567.
Edit 2: after fixing metro/src/node-haste/DependencyGraph/ModuleResolution.js (see https://github.com/facebook/metro/pull/567/files) I'm getting this error:

Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4 from C:\Users\Samuel\Development\CourseApp2/.: ./debugger-ui/debuggerWorker.aca173c4 could not be found within the project or in these directories:
  node_modules

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
    at ModuleResolver.resolveDependency (C:\Users\Samuel\Development\CourseApp2\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:234:15)
    at DependencyGraph.resolveDependency (C:\Users\Samuel\Development\CourseApp2\node_modules\metro\src\node-haste\DependencyGraph.js:413:43)
    at C:\Users\Samuel\Development\CourseApp2\node_modules\metro\src\lib\transformHelpers.js:317:42
    at C:\Users\Samuel\Development\CourseApp2\node_modules\metro\src\Server.js:1471:14
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\Samuel\Development\CourseApp2\node_modules\metro\src\Server.js:146:24)
    at _next (C:\Users\Samuel\Development\CourseApp2\node_modules\metro\src\Server.js:168:9)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Now I'm not sure if that's related to the typescript template, or even if that's the same issue @pranshuchittora is facing...

@radko93
Copy link
Collaborator

radko93 commented Mar 23, 2021

@dgellow can you try to create a project without the template and if you can reproduce it?

@dgellow
Copy link

dgellow commented Mar 23, 2021

Hey @radko93. I did this a few minutes ago, and yes I can reproduce without the typescript template.
There are two things:

  1. There is a bug in metro itself (as mentioned in my previous message, see Prevent unhandled rejection with buildCodeFrameMessage facebook/metro#567)
  2. And at least for my case, another bug somewhere else that I haven't located yet.

So it doesn't seem to be related to the typescript template. I believe that we can close this issue, but I'm not the one who created it, and do not know if @pranshuchittora is actually facing the same issue. The symptom look the same because of the bug in metro, but that's it. Once you apply the patch to fix metro you get the actual error message ("Error: unable to resolve module ").

@emin93
Copy link
Member

emin93 commented Jul 4, 2021

Closing this as this seems to be not related to this template and an issue in the RN repo should be created instead.

@emin93 emin93 closed this as completed Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants