react-native-community / react-native-template-typescript

👾 Clean and minimalist React Native template for a quick start with TypeScript.
https://www.npmjs.com/package/react-native-template-typescript
MIT License
1.86k stars 398 forks source link

App Crashing on Debug #198

Closed pranshuchittora closed 3 years ago

pranshuchittora commented 3 years ago

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 commented 3 years ago

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

dgellow commented 3 years ago

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 https://github.com/facebook/metro/pull/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 commented 3 years ago

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

dgellow commented 3 years ago

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 https://github.com/facebook/metro/pull/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 commented 3 years ago

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