react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

Failed to parse source map from ...

Open pascal-mueller opened this issue 1 year ago • 3 comments

Issue Description

I'm trying to add react-native-gifted-chat to my expo application. I added the example component given in the README. I get a lot of the following warnings.

WARNING in ./node_modules/react-native-gifted-chat/lib/logging.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/.../node_modules/react-native-gifted-chat/src/logging.ts' file: Error: ENOENT: no such file or directory, open '/home/pascal/projects/spark/spark-ui/node_modules/react-native-gifted-chat/src/logging.ts'

Now I observed the following:

`cat /home/.../node_modules/react-native-gifted-chat/src/logging.ts`

which gives `No such file or directory`, that's because there is no `src` dir in `node_modules/react-native-gifted-chat/` but there is `lib`. So the Error makes sense.

My question is: Why are those files missing?

#### Steps to Reproduce / Code Snippets

Here's my package.json

{
  "name": "myapp",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/webpack-config": "^18.0.1",
    "@react-navigation/bottom-tabs": "^6.5.7",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "expo": "~48.0.15",
    "expo-crypto": "~12.2.1",
    "expo-secure-store": "~12.1.1",
    "expo-status-bar": "~1.4.4",
    "formik": "^2.2.9",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-lifecycles-compat": "^3.0.4",
    "react-native": "0.71.8",
    "react-native-base64": "^0.2.1",
    "react-native-gifted-chat": "^2.1.0",
    "react-native-web": "~0.18.10",
    "socket.io-client": "^4.6.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.0.27",
    "@types/react-native": "^0.72.1",
    "typescript": "^4.9.4"
  },
  "private": true
}

Expected Results

I expect the files of the dependency to exist.

Additional Information

See packagejson above:

  • Nodejs version: v19.9.0
  • React version: [FILL THIS OUT]
  • React Native version: [FILL THIS OUT]
  • react-native-gifted-chat version: [FILL THIS OUT]
  • Platform(s) (iOS, Android, or both?): Currently only tested on web
  • TypeScript version: [FILL THIS OUT]

pascal-mueller avatar May 29 '23 22:05 pascal-mueller

HI, I am running into the same or similar issue. where you able to resolve?

LisaGenner avatar May 31 '23 16:05 LisaGenner

I didn't had time to look into it yet. Since the source maps are only used for debugging i.e. during development, it isn't critical for a functional application. You can basically ignore them since in production mode they shouldn't show up at all.

I used the env variable GENERATE_SOURCEMAP=false to get rid of the warnings since the files are simply not generated. You can add it to the scripts key in the package.json e.g. like this

    "scripts": {
        "start": "GENERATE_SOURCEMAP=false && expo start",
        "android": "expo start --android",
        "ios": "expo start --ios",
        "web": "expo start --web"
    },

but it doesn't do much since it doesn't work for hot reload. If I find the time to look into it in detail and I find the actual issue, I'd post here.

pascal-mueller avatar Jun 02 '23 18:06 pascal-mueller

Hello, I'm running into the same issue.

Lautarotetamusa avatar Feb 16 '24 18:02 Lautarotetamusa