我正在尝试将基本的Hello World suitescript上传到netsuite,并收到此错误:
无法评估脚本:
{
"type": "error.SuiteScriptModuleLoaderError",
"name": "UNEXPECTED_ERROR",
"message": "missing } after property list (SS_SCRIPT_FOR_METADATA#29)",
"stack": []
}
下面的代码:
/**
*@NApiVersion 2.0
*@NScriptType ClientScript
*@NModuleScope SameAccount
*/
define(['N/ui/dialog'],
function(dialog) {
function helloWorld() {
var options = {
title: 'Hello!',
message: "Hello, world!"
};
try {
dialog.alert(options);
log.debug({
title: 'Success',
details: 'Alert displayed successfully'
});
} catch (e) {
log.error({
title: 'Failure',
details: 'Alert displayed unsuccessfully'
});
}
}
return {
pageInit: helloWorld
};
});
有人可以提供任何建议吗?谢谢!
我相信我以前曾经遇到过。JSDoc与define函数一起使用,因此JSDoc的末尾和define之间的多余行引起了一些解析问题。
更改:
/**
*@NApiVersion 2.0
*@NScriptType ClientScript
*@NModuleScope SameAccount
*/
define(['N/ui/dialog'],
to
/**
*@NApiVersion 2.0
*@NScriptType ClientScript
*@NModuleScope SameAccount
*/
define(['N/ui/dialog'],