_appwrite.default不是一个函数(未定义),js引擎:hermes显示此错误

问题描述 投票:0回答:1

我第一次使用应用程序写入,但在身份验证用户(注册)期间显示错误,所以这里有什么问题?

import { Account, Client, ID } from 'react-native-appwrite';
export const config = {
    endPoint: "https://cloud.appwrite.io/v1",
    platform: 'xyx',
    projectId: 'xyx',
    databaseId: 'xyx',
    userCollectionId: 'xyx',
    videoCollectionId: 'xyx',
    storageId: 'xyx'
}

const client = new Client();

client
    .setEndpoint(config.endPoint)
    .setProject(config.projectId)
    .setPlatform(config.platform)
    ;

const account = new Account(client);

export const CreateUser = () => {
    account.create(ID.unique(), '[email protected]', 'password', 'Jane Doe')
        .then(function (response) {
            console.log(response);
        }, function (error) {
            console.log(error);
        });
}
react-native expo
1个回答
0
投票

检查您导入 createUser 函数的文件...应该像这样导入

从“”导入{createUser};不像这样 import createUser from "";

© www.soinside.com 2019 - 2024. All rights reserved.