Hi all, I wrote the SuiteScript version of 2.0 in...
# suitecommerce
s
Hi all, I wrote the SuiteScript version of 2.0 in Backend model. When I am trying to activate the extension I'm getting this error. Can any one help me? {"type":"error.SuiteScriptError","name":"23853","message":"Invalid define call, define should only be called once per module. Define calls found at the following line numbers: tmp_myaccount_2.js 41, 72, 105, 147, 273, 319, 348, 396, 500, 528, 567","stack":["createError(N/error)"],"cause":{"message":"Invalid define call, define should only be called once per module. Define calls found at the following line numbers: tmp_myaccount_2.js 41, 72, 105, 147, 273, 319, 348, 396, 500, 528, 567","stack":["createError(N/error)","reduce(/SuiteBundles/Bundle 317001/ExtensionMechanism.Server/CompilersMapReduce/JsCompilerMapReduce.js:271)"],"name":"23853"},"id":"","notifyOff":false,"userFacing":true}
s
It would be helpful if you could also post the code in your module. But my first thought is that if this is meant to be a SuiteScript 2 model file then you probably have incorrectly flagged it as a SuiteScript 1 file as it should not go through the compiler
I would check your manifest to make sure that you have flagged it as a SuiteScript 2.0 file AND you have NOT flagged it as a SuiteScript 1.0 file
s
"local_folder": "Workspace\\RedeemHistory", "suitescript2": { "files": [ "Modules/RedeemHistory/SuiteScript2/RedeemHistory.Model.js", "Modules/RedeemHistory/SuiteScript2/RedeemHistory.Service.ss" ] }
s
And your SuiteScript object?
s
define([], function () { 'use strict'; var RedeemHistoryModel = { get: function (request) { var data = { message: 'This is a message sent from the server!' } return data } } return RedeemHistoryModel })
s
No, your SuiteScript object in the manifest
s
Copy code
{
  "name": "RedeemHistory",
  "fantasyName": "RedeemHistory",
  "vendor": "Netscore",
  "version": "1.0.0",
  "type": "extension",
  "target": "SCA,SCS",
  "target_version": {
    "SCA": ">=20.1.0",
    "SCS": ">=20.1.0"
  },
  "description": "this extension is used for displaying customer's redeem events.",
  "skins": [],
  "assets": {
    "img": {
      "files": []
    },
    "fonts": {
      "files": []
    },
    "services": {
      "files": []
    }
  },
  "sass": {
    "entry_points": {
      "myaccount": "Modules/RedeemHistory/Sass/_redeemhistory-redeemhistory.scss"
    },
    "files": [
      "Modules/RedeemHistory/Sass/_redeemhistory-redeemhistory.scss"
    ]
  },
  "templates": {
    "application": {
      "myaccount": {
        "files": [
          "Modules/RedeemHistory/Templates/netscore_redeemhistory_redeemhistory.tpl"
        ]
      }
    }
  },
  "javascript": {
    "entry_points": {
      "myaccount": "Modules/RedeemHistory/JavaScript/Netscore.RedeemHistory.RedeemHistory.js"
    },
    "application": {
      "myaccount": {
        "files": [
          "Modules/RedeemHistory/JavaScript/Netscore.RedeemHistory.RedeemHistory.js",
          "Modules/RedeemHistory/JavaScript/RedeemHistory.View.js",
          "Modules/RedeemHistory/JavaScript/Netscore.RedeemHistory.RedeemHistory.Model.js",
          "Modules/RedeemHistory/JavaScript/Netscore.RedeemHistory.RedeemHistory.SS2Model.js",
          "Modules/RedeemHistory/JavaScript/RedeemHistory.Router.js",
          "Modules/RedeemHistory/SuiteScript2/RedeemHistory.Model.js"
        ]
      }
    }
  },
  "local_folder": "Workspace\\RedeemHistory",
  "suitescript2": {
    "files": [
      "Modules/RedeemHistory/SuiteScript2/RedeemHistory.Model.js",
      "Modules/RedeemHistory/SuiteScript2/RedeemHistory.Service.ss"
    ]
  }
}
that is complete manifest file.
s
Yeah, do you see the problem?
s
yes
s
Your SuiteScript 2 model is being included in the JavaScript
s
yes
message has been deleted
s
Right, so remove it as an entry in the array and when the tools prompt you about it, select None
s
And also in console I'm facing this error.
s
Yes until you correct the manifest, it will keep happening
s
ok, Thank you.