Parsing error: Unexpected reserved word 'await'. 239 | const form = Object.assign(this.form, this.snmpv1Form) 240 | this.setDiscoverForm(form) > 241 | const { data: res } = await startAutoFind (form)
时间: 2024-03-14 13:45:42 浏览: 139
这个错误通常是由于在非异步函数中使用了await关键字引起的。在这个代码片段中,错误可能是因为该代码块所在的函数没有被声明为异步函数。你需要确保该函数前面有async关键字来声明该函数是一个异步函数,才能在其中使用await关键字。如下所示:
```
async function someFunction() {
const form = Object.assign(this.form, this.snmpv1Form)
this.setDiscoverForm(form)
const { data: res } = await startAutoFind (form)
// rest of the code
}
```
这样,就能够在该函数中使用await关键字了。
相关问题
train datasets not valid: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are: 1. Downgrade the protobuf package to 3.20.x or lower. 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower). More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates 2023-04-20 18:34:06,539 - [ERROR]: failed: TrainFailReason.ERROR_PARAM, datasets not valid: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are: 1. Downgrade the protobuf package to 3.20.x or lower. 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower). More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates Exception ignored in: <function Detector.__del__ at 0x7fa39ff51550> Traceback (most recent call last): File "/home/zzh/Desktop/maix_train/train/detector/__init__.py", line 117, in __del__ if self.need_rm_datasets: AttributeError: 'Detector' object has no attribute 'need_rm_datasets'
训练数据集无效:不能直接创建描述符。如果这个调用来自一个_pb2.py文件,你的生成代码已经过期,必须使用protoc >= 3.19.0重新生成。如果你无法立即重新生成你的protos,一些可能的解决方法是:1.将protobuf软件包降级到3.20.x或更低版本。2.设置PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python(但这将使用纯Python解析,速度会慢得多)。更多信息请参见:https://developers.google.com/protocol-buffers/docs/news/2022-05-06。
Internal server error: Error parsing JavaScript expression: Unexpected token, expected "," (1:5)
As an AI language model, I don't have access to the specific code causing this error. However, based on the error message, it seems like there is a syntax error in a JavaScript expression. The error is saying that it was expecting a comma but instead encountered an unexpected token at position 1, character 5.
To fix this error, you should review the JavaScript code and check for any missing or misplaced commas. Make sure that all the syntax is correct and that you have closed all brackets and parentheses properly. You can also try using a JavaScript linter or debugger to help identify and fix the error.
阅读全文