0
votes

I am trying to upload a basic Hello World suitescript into netsuite and am receiving this error:

Fail to evaluate script:

{
    "type": "error.SuiteScriptModuleLoaderError",
    "name": "UNEXPECTED_ERROR",
    "message": "missing } after property list (SS_SCRIPT_FOR_METADATA#29)",
    "stack": []
}

Code below:

/**
 *@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
        };
    });

Can anyone provide any suggestion? Thanks!

2

2 Answers

0
votes

Did not find anything wrong in your script. Please try using different file name but same code. Try creating new script record and deployment.

0
votes

I believe I've run into this before. The JSDoc goes with the define function so the extra line between the end of the JSDoc and the define causes some parsing issue.

Change:

/**
 *@NApiVersion 2.0
 *@NScriptType ClientScript
 *@NModuleScope SameAccount
 */

define(['N/ui/dialog'], 

to

/**
 *@NApiVersion 2.0
 *@NScriptType ClientScript
 *@NModuleScope SameAccount
 */
define(['N/ui/dialog'],