导入Amplify引发错误“ NULL不是对象(评估' keys.filter)”在React Native应用中
每当我将放大到我的React Native Project的app.js文件中时,我都会收到以下错误:
TypeError: null is not an object (evaluating 'keys.filter')
这就是我的导入方式:
我仅使用Expo运行该项目。如果我评论导入Amplify
line Out,则使用与放大有关的任何其他文件会导致相同的错误发生。
最初,当我第一次加载该项目时,我还有其他错误需要处理,例如首先需要创建AWS-Exports.js文件。我从一个旧的项目中复制了这一点(因为这是要重新完成已经设置的另一个项目)。一旦包含该文件,我就必须在该文件中更新几行,因为对Expo的链接不当。修复了这一点后,就会在此处引用此错误。现在,即使我删除了AWS-Exports文件,一旦将Amplify导入到app.js文件中,也会立即丢弃此错误。
我的某些代码被执行,但是当两个内存软件之间同步时,错误发生在reationnative.js文件中。
我试图通过复制package.js文件,然后将放大器导入到app.js文件中,从而在新的React应用程序中重现此错误,但不会丢弃此错误。
这是发生错误发生的位置的屏幕截图。我仍在尝试弄清楚如何在代码中查明此错误开始的位置。
Any time I import Amplify into my React Native project's App.js file, I get the following error:
TypeError: null is not an object (evaluating 'keys.filter')
Here is how I'm importing it:
I run the project using Expo only. If I comment the import Amplify
line out, any other files which use anything related to Amplify cause the same error to occur.
Initially, when I was loading this project for the first time, I had other errors to deal with like first needing to create the aws-exports.js file. I copied this over from an old project (Because this is meant to be a re-do of another project that's already set up). Once I included that file I had to update a few lines in that file because of an improper reference to Linking from expo. Once I fixed that, it throw this error I'm referencing here. Now, even if I delete the aws-exports file it will throw this error as soon as Amplify is imported into the App.js file.
-- Update
I've found where the error is occurring. Some of my code gets executed but the error happens inside of the reactnative.js file when syncing between two memory software.
I've tried to reproduce this error inside a fresh react application by copying the package.js file and then importing Amplify into the App.js file but it doesn't throw this error.
Here is a screenshot of where the error is taking place. I'm still trying to figure out how to pinpoint where in my code this error begins.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据EXPO,您必须遵循以下步骤,
如果您导入将所有需要遵循的所有步骤进行放大,则最好的是,
它看到了配置问题结果数据不到来,这就是为什么它给出无效的值并崩溃的原因。
按照下面的步骤解决您的问题
According to Expo, you have to follow these steps
it would be best if you imported Amplify
All you need to follow those steps it sees the configuration issue result data is not coming that's why it gives a null value and crashes.
Follow steps below will fix your problem
通过更改React App.json文件中的slug属性来解决问题。我从骆驼盒变成了所有较低的表壳。
在此之后,似乎永久性的错误已经消失。我已经能够在小型示例应用程序中复制错误。我不明白为什么这会导致这些错误。
The problem seems to be resolved by changing the slug attribute in the react app.json file. I changed the slug from being a camel case to an all lower case slug.
After this the error has gone away for what seems permanent. I've been able to replicate the error in small sample apps. I don't understand why this causes these errors.