小编Sum*_*ois的帖子

React-native 尝试读取图像文件时检测到无效的 UTF-8

我正在尝试使用react-native-fsredux-saga使用URI读取图像文件:

file:///var/mobile/Containers/Data/Application/605FB6C0-869C-4128-883E-A59616933C64/Documents/images/52108C66-A087-4942-9DD4-22CBD0327089.jpg

下面是我在尝试读取图像文件时遇到错误的行:

const imageFile = yield call([RNFS, RNFS.readFile], logo.uri);
Run Code Online (Sandbox Code Playgroud)

以下是我收到的错误:

Error: Invalid UTF-8 detected
    at decodeSymbol (utf8.js:194)
    at Object.utf8decode [as decode] (utf8.js:206)
    at FS.common.js:150
    at tryCallOne (core.js:37)
    at core.js:123
    at JSTimers.js:301
    at _callTimer (JSTimers.js:154)
    at _callImmediatesPass (JSTimers.js:202)
    at Object.callImmediates (JSTimers.js:470)
    at MessageQueue.__callImmediates (MessageQueue.js:275)
    at MessageQueue.js:140
Run Code Online (Sandbox Code Playgroud)

有人可以告诉我我做错了什么吗?

javascript react-native redux-saga react-redux react-native-fs

5
推荐指数
2
解决办法
7877
查看次数

减速器不更新状态

我正在尝试使用更新应用程序状态,react-redux但状态未更新。

下面是我的reducers.js:

import * as Actions from '../actions/index';

const initialState = {
  user: {},
  authSuccess: false,
  authError: {},
};

function Auth(state = initialState , action) {
    switch(action.type) {
      case Actions.SIGN_UP_SUCCESS:
           console.log(action.user); // Is being logged and its not undefined
          return {
              user: action.user,
              authSuccess: true,
              ...state
          };
      case Actions.AUTHENTICATION_FAILED:
          console.log(action.error); // Is being logged and its not undefined
          return {
              authError: action.error,
              ...state
          };
      case Actions.LOGIN_SUCCESS:
          console.log(action.user); // Is being logged and its not undefined
          return { …
Run Code Online (Sandbox Code Playgroud)

javascript react-native redux

4
推荐指数
1
解决办法
6097
查看次数

错误:您无法将 gems 与 Shopify CLI 一起使用

我是 Shopify 主题开发的新手。目前正在学习 Shopify 的教程。一切都很顺利,但每次运行“Shopify 主题服务”时,我都会收到以下错误:

[Note] You cannot use gems with Shopify CLI.
[LoadError] cannot load such file -- wdm
       They are disabled.
       Please don't modify the CLI locally.
       If you would like to contribute to the CLI project, please refer to
       https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md

  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
X You are not authorized to edit themes on banana-man-co.myshopify.com.
Make sure you are a user of that …
Run Code Online (Sandbox Code Playgroud)

ruby rubygems shopify

2
推荐指数
1
解决办法
4630
查看次数