我正在尝试使用react-native-fs和redux-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
我正在尝试使用更新应用程序状态,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) 我是 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) javascript ×2
react-native ×2
react-redux ×1
redux ×1
redux-saga ×1
ruby ×1
rubygems ×1
shopify ×1