【发布时间】:2022-01-08 20:19:43
【问题描述】:
我使用 back4app 作为后端服务来部署我的应用程序,它是用 React Native ans JS 开发的。我现在正在测试如何使用 back4app 的“云代码功能”...
由于我是 back4app 的初学者,我在使用他们的指南时发现了一个问题。我正面临这条消息错误:'async functions' is only available in ES8 (use 'esversion: 8').:
Back4app 端:
import Parse from 'parse/react-native.js';
import AsyncStorage from '@react-native-async-storage/async-storage';
//Initializing the SDK
Parse.setAsyncStorage(AsyncStorage);
//Paste below the Back4App Application ID AND the JavaScript KEY
Parse.initialize('YOUR_APPLICATION_ID_HERE', 'YOUR_JAVASCRIPT_KEY_HERE');
//Point to Back4App Parse API address
Parse.serverURL = 'https://parseapi.back4app.com/';
//This is a hello function and will log a message on the console
Parse.Cloud.define("hello", async (request) => {
console.log("Hello from Cloud Code!");
return "Hello from Cloud Code!";
});
我的应用:
const helloFunction = await Parse.Cloud.run("hello");
我知道问题来自异步函数,但我找不到任何解决方案。我做错了什么?
【问题讨论】:
标签: javascript reactjs react-native back4app