react-native-gifted-chat: react-native-gifted-chat\node_modules\expo\AppEntry.js not found

Issue Description

When intsalling the last version of gifted chat (0.9.*) i have an error at metro launch. Herer is the error :

error: bundling failed: Error: While trying to resolve module react-native-gift ed-chat from file C:\Users\nount\WebstormProjects\daate\src\screens\user\showP rofile4.js, the package C:\Users\nount\WebstormProjects\daate\node_modules\rea ct-native-gifted-chat\package.json was successfully found. However, this packag e itself specifies a main module field that could not be resolved (C:\Users\n ount\WebstormProjects\daate\node_modules\react-native-gifted-chat\node_modules\e xpo\AppEntry.js. Indeed, none of these files exist:

  • C:\Users\nount\WebstormProjects\daate\node_modules\react-native-gifted-chat \node_modules\expo\AppEntry.js(.native||.android.js|.native.js|.js|.android.json |.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • C:\Users\nount\WebstormProjects\daate\node_modules\react-native-gifted-chat \node_modules\expo\AppEntry.js\index(.native||.android.js|.native.js|.js|.androi d.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.t sx) at ResolutionRequest.resolveDependency (C:\Users\nount\WebstormProjects\daat e\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:65:15) at DependencyGraph.resolveDependency (C:\Users\nount\WebstormProjects\daate\ node_modules\metro\src\node-haste\DependencyGraph.js:283:16) at Object.resolve (C:\Users\nount\WebstormProjects\daate\node_modules\metro\ src\lib\transformHelpers.js:261:42) at dependencies.map.result (C:\Users\nount\WebstormProjects\daate\node_modul es\metro\src\DeltaBundler\traverseDependencies.js:399:31) at Array.map (<anonymous>) at resolveDependencies (C:\Users\nount\WebstormProjects\daate\node_modules\m etro\src\DeltaBundler\traverseDependencies.js:396:18) at C:\Users\nount\WebstormProjects\daate\node_modules\metro\src\DeltaBundler \traverseDependencies.js:269:33 at Generator.next (<anonymous>) at asyncGeneratorStep (C:\Users\nount\WebstormProjects\daate\node_modules\me tro\src\DeltaBundler\traverseDependencies.js:87:24) at _next (C:\Users\nount\WebstormProjects\daate\node_modules\metro\src\Delta Bundler\traverseDependencies.js:107:9) ::1 - - [12/Jun/2019:12:19:02 +0000] “GET /index.delta?platform=android&dev=true &minify=false&revisionId=ac05c803b916d881 HTTP/1.1” 500 - “http://localhost:8081 /debugger-ui/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH TML, like Gecko) Chrome/74.0.3729.169 Safari/537.36” DELTA [android, dev] ./index.js ▓▓░░░░░░░░░░░░░░ 18.5% (186/518), failed.

::1 - - [12/Jun/2019:12:20:35 +0000] “GET /index.delta?platform=android&dev=true &minify=false HTTP/1.1” 500 - “http://localhost:8081/debugger-ui/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0 .3729.169 Safari/537.36” error: bundling failed: Error: While trying to resolve module react-native-gift ed-chat from file C:\Users\nount\WebstormProjects\daate\src\screens\user\showP rofile4.js, the package C:\Users\nount\WebstormProjects\daate\node_modules\rea ct-native-gifted-chat\package.json was successfully found. However, this packag e itself specifies a main module field that could not be resolved (C:\Users\n ount\WebstormProjects\daate\node_modules\react-native-gifted-chat\node_modules\e xpo\AppEntry.js. Indeed, none of these files exist:

  • C:\Users\nount\WebstormProjects\daate\node_modules\react-native-gifted-chat \node_modules\expo\AppEntry.js(.native||.android.js|.native.js|.js|.android.json |.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • C:\Users\nount\WebstormProjects\daate\node_modules\react-native-gifted-chat \node_modules\expo\AppEntry.js\index(.native||.android.js|.native.js|.js|.androi d.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.t sx) at ResolutionRequest.resolveDependency (C:\Users\nount\WebstormProjects\daat e\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:65:15) at DependencyGraph.resolveDependency (C:\Users\nount\WebstormProjects\daate\ node_modules\metro\src\node-haste\DependencyGraph.js:283:16) at Object.resolve (C:\Users\nount\WebstormProjects\daate\node_modules\metro\ src\lib\transformHelpers.js:261:42) at dependencies.map.result (C:\Users\nount\WebstormProjects\daate\node_modul es\metro\src\DeltaBundler\traverseDependencies.js:399:31) at Array.map (<anonymous>) at resolveDependencies (C:\Users\nount\WebstormProjects\daate\node_modules\m etro\src\DeltaBundler\traverseDependencies.js:396:18) at C:\Users\nount\WebstormProjects\daate\node_modules\metro\src\DeltaBundler \traverseDependencies.js:269:33 at Generator.next (<anonymous>) at asyncGeneratorStep (C:\Users\nount\WebstormProjects\daate\node_modules\me tro\src\DeltaBundler\traverseDependencies.js:87:24) at _next (C:\Users\nount\WebstormProjects\daate\node_modules\metro\src\Delta Bundler\traverseDependencies.js:107:9) DELTA [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.

Steps to Reproduce / Code Snippets

Install the last version of gifted chat (0.9.*), then try to launch your app

Expected Results

Have gifted chat working

Additional Information

  • Nodejs version: 10.16.0
  • React version: 16.8.3
  • React Native version: 0.59.8
  • react-native-gifted-chat version: 0.9.3
  • Platform(s) (iOS, Android, or both?): Both

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16

Most upvoted comments

I have no idea why this has been closed, or it’s perceived as not being related related to this library.

@tmjordan, I’ve also faced the same issue, it appears like the contents of the published version of gifted-chat is different than the version you fork, and this is because npm runs a prepublishing process (https://docs.npmjs.com/misc/scripts) before actually publishing it, I’ve been managed to get my fork to work this way: On my main application, I’ve added the following postinstall script:

"scripts": { "postinstall": "cd node_modules/react-native-gifted-chat && yarn install && yarn lint && yarn build && yarn config:npm && rm -rf node_modules" },

yarn build is failing because of warning/erros while compiling with tsc. How do you make sure, build is successful ? I am not using typescript in my project. I am trying to use my own fork. image