私はReact NativeとFirebaseを自分のアプリで使っています。そして、どこからともなく私はこのエラーが供給開始しました: ローカルですでに利用可能な画像を提供しました
SyntaxError: Unexpected end of JSON input.
at doWrite(_stream_writable.js)
at Promise.resolve.then.then.then.catch.then.message
、私の中には、パッケージャを反応させることが、このコードを指している:
componentMountが呼び出されたときに実行されているonProfilesChange = async (snap) => {
var allProfilePromises = []
snap.forEach((child) => {
var profileId = child.val().profileId
var alreadyAdded = this.state.profiles.some(x => x.id === profileId)
if (alreadyAdded === false) {
var profilePromise = this.registerOnProfileChanges(profileId)
allProfilePromises.push(profilePromise)
}
})
await Promise.all(allProfilePromises)
var profileCount = snap.numChildren()
this.setState({ profiles: this.state.profiles, loading: false, profileCount: profileCount })
if (profileCount <= 0) {
this.getUserName()
}
}
。今、エラーは非常にはっきりしていますが、私はそれがなぜ生産されているのか、どのようにそれを渡すのか分かりません。このコードは何も変更せずに何ヶ月も働いています。
ありがとうございます。