react / react/react-native

When using FileReader readAsDataURL it does not load blob file, no error

オープン
#38,230 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Issue: Author Provided Repro Needs: Triage :mag: Newer Patch Available
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

When I run this code below the load event does not print the log and therefore the blob file is not being converted into a uri.

`if (messageModel.item.image) {
console.log(messageModel.item.id, "has image");
const imgBlob = messageModel.item.image;

  let reader = new FileReader();
  reader.addEventListener(
    "load",
    () => {
      console.log("loaded");
    },
    false
  );
  reader.readAsDataURL(imgBlob);
}`
React Native Version

0.71.0

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 13.4.1
CPU: (10) arm64 Apple M1 Max
Memory: 325.55 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.15.0 - /usr/local/bin/node
Yarn: 3.4.1 - /usr/local/bin/yarn
npm: 9.5.0 - /usr/local/bin/npm
Watchman: 2023.06.12.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.0 - /Users/davidchoi/.rvm/rubies/ruby-2.7.6/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.6 => 0.71.6
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
info React Native v0.72.1 is now available (your project is running on v0.71.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.72.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.71.6
info For more info, check out "https://reactnative.dev/docs/upgrading".

Steps to reproduce

Simply running the code I showed in a expo 48 app will do it. But you can also look at my repo if you want.

Snack, code example, screenshot, or link to a repository

This is the repo, https://github.com/jsoneaday/learn-react-native-fast. Code is in section_3/chatter

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンク先のリポジトリにある section_3/chatter の例で問題を再現します。まず FileReader の readAsDataURL 呼び出しとその load リスナーから始めてください。報告されている React Native 0.71.6 と Expo 48 のセットアップでの動作を比較し、期待される blob 変換と load イベントを示す、焦点を絞った再現またはテストを特定してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react-native
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。