Metro: Unexpected end of JSON input

Created on 12 Mar 2019  路  5Comments  路  Source: facebook/metro

Hi, today when i start working i receive this error:

error: bundling failed: SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at FileStore.get (/Users/user/Projects/project/node_modules/metro-cache/src/stores/FileStore.js:26:19)
at /Users/user/Projects/project/node_modules/metro-cache/src/Cache.js:76:40
...

It's a know error? What can i do to debug it?

react-native: 0.57.8
npm: 6.7.0
node: 10.14.1

Most helpful comment

I've come across this one a couple of times already because I keep gettings this error and I don't want to restart my computer each time (even though it works)

This way I was able to fix it
rm -rf ~/Library/Developer/Xcode/DerivedData && rm -rf ./node_modules && npm cache clean --force && yarn && react-native link && react-native run-ios

Not sure if you really need all of it but at least it does the trick for me.

All 5 comments

I've restart my computer and this error has gone. Simple as it.

I've come across this one a couple of times already because I keep gettings this error and I don't want to restart my computer each time (even though it works)

This way I was able to fix it
rm -rf ~/Library/Developer/Xcode/DerivedData && rm -rf ./node_modules && npm cache clean --force && yarn && react-native link && react-native run-ios

Not sure if you really need all of it but at least it does the trick for me.

I have faced the same issue. Tried to build the apk with "gradlew clean assembleRelease" then "react-native run-android" as normally. It works

gradlew clean assembleRelease like same way how can i clean in react-native windows

windows delete 'C:\Users\admin\AppData\Local\Temp\metro-cache\'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samuela picture samuela  路  4Comments

dlferro picture dlferro  路  5Comments

andrew-wagner89 picture andrew-wagner89  路  6Comments

IljaDaderko picture IljaDaderko  路  5Comments

JaEdmuva picture JaEdmuva  路  3Comments