FaridSafi / react-native-gifted-chat

💬 The most complete chat UI for React Native
https://gifted.chat
MIT License
13.36k stars 3.53k forks source link

Example build fails to run #2504

Open vassantn opened 3 weeks ago

vassantn commented 3 weeks ago

Issue Description

I'm encountering an error when trying to run the example build

/home/user9390/Downloads/react-native-gifted-chat/node_modules/metro/node_modules/jest-haste-map/build/index.js:569
          throw new Error(message);
                ^

Error: jest-haste-map: Haste module naming collision:
  Duplicate module name: react-animated
  Paths: /home/user9390/Downloads/react-native-gifted-chat/node_modules/react-native/Libraries/Animated/release/package.json collides with /home/user9390/Downloads/react-native-gifted-chat/node_modules/expo/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by `hasteImpl` returning the same name for different files.
    at setModule (/home/user9390/Downloads/react-native-gifted-chat/node_modules/metro/node_modules/jest-haste-map/build/index.js:569:17)
    at workerReply (/home/user9390/Downloads/react-native-gifted-chat/node_modules/metro/node_modules/jest-haste-map/build/index.js:641:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 21756)

Node.js v22.1.0

Steps to Reproduce / Code Snippets

  1. git clone https://github.com/FaridSafi/react-native-gifted-chat
  2. cd react-native-gifted-chat
  3. npm install
  4. expo start

Additional Information

xuelink commented 1 week ago

facing the same issue

Logs for your project will appear below. Press Ctrl+C to exit.
Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at stableHash (/Users/xl/Developer/react-native-gifted-chat/example/node_modules/metro-cache/src/stableHash.js:19:8)
    at Object.getCacheKey (/Users/xl/Developer/react-native-gifted-chat/example/node_modules/metro-transform-worker/src/index.js:647:7)
    at getTransformCacheKey (/Users/xl/Developer/react-native-gifted-chat/example/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:32:19)
    at new Transformer (/Users/xl/Developer/react-native-gifted-chat/example/node_modules/metro/src/DeltaBundler/Transformer.js:180:28)
    at /Users/xl/Developer/react-native-gifted-chat/example/node_modules/metro/src/Bundler.js:58:29
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
  ERROR in ../src/Constant.ts:1
Module not found: Can't resolve 'react-native'
> 1 | import { Platform } from 'react-native'
  2 |
  3 | export const MIN_COMPOSER_HEIGHT = Platform.select({
  4 |   ios: 33,

ERROR in ../src/GiftedChat.tsx 55:7
Module parse failed: Unexpected token (55:7)
File was processed with these loaders:
 * ../../../.nvm/versions/node/v21.1.0/lib/node_modules/expo-cli/node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| dayjs.extend(localizedFormat)
|
> export interface GiftedChatProps<TMessage extends IMessage = IMessage> {
|   /* Message container ref */
|   messageContainerRef?: React.RefObject<FlatList<IMessage>>

ERROR in ../src/utils.ts 14:16
Module parse failed: Unexpected token (14:16)
File was processed with these loaders:
 * ../../../.nvm/versions/node/v21.1.0/lib/node_modules/expo-cli/node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
|
| export function isSameDay(
>   currentMessage: IMessage,
|   diffMessage: IMessage | null | undefined,
| ) {

web compiled with 3 errors and 29 warnings