类型错误:导入“react-native-fs”时,null 不是对象错误

问题描述

导致错误的那一行是这样的:

const RNFS = require('react-native-fs')

我得到的错误是:

TypeError: null is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular')

解决方法

这似乎是您的自动链接问题。做

  1. www.website1.com/blog/2020/abc -> www.website2.com/blog/2020/abc www.website1.com/blog/2021/rst -> www.website2.com/blog/2021/rst www.website1.com/blog/2022/xyz -> www.website2.com/blog/2022/xyz
  2. 然后在您的根文件夹 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_URI} ^/blog/(.*)$ RewriteRule ^(.*) https://website2.com/blog/%1 [R=301,NC]
    注意:确保在第 2 步之前从模拟器或真实设备中卸载应用程序。