Error when uploading files, and/or deploying using...
# sdf
d
Error when uploading files, and/or deploying using SDF.
SuiteScript 2.0 entry point scripts must implement one script type function..
Does anyone know how to troubleshoot this? The files which get this error are using custom imports placed in the SuiteScripts-folder in the FileCabinet.
j
Assuming your actual entry point scripts do have entry points, I had something similar happen when I created a library type module being imported into a UE or ClientScript. In the lib module I was using a let statement which was causing a problem for the UE 2.0 script.
I just slowly worked through my imports in the UE commenting out the import until I found the one with the issue.
d
All my scripts are using the 2.1 API version but, yea, i suppose I have to do that.
Would have been nice to get a more vocal validation with failing lines 😄
j
Sorry about that thought you were on 2.0. Still believe points to something not supported in the custom modules though
e
Are you converting a script from 2.0 to 2.1?
Because the error says your script is 2.0, meaning that if you're doing something like
Copy code
return {
  pageInit,
  fieldChanged
};
that won't be valid syntax.
🤔 1
I ran into this as well where I converted 2.0 to 2.1, but the Script record didn't update. I had to: 1. Change all my code back to 2.0 2. Change only the
@NApiVersion
tag 3. Edit the Script record slightly to ensure it changed to 2.1 4. Change code to 2.1
d
No we’re not converting from 2.0, everything has been written as 2.1 except for clientscripts which have the 2.x tag.
I checked the scripts page and everything is listed as 2.1, so I have idea why the error says 2.0. But I’ll see if reverting some “clever” ES6 syntax might help. We have not yet setup any compiling/transpiling in our setup. Perhaps this might get us there.
So finally I resolved my issues and managed to deploy the project to another development environment. This was achieved by deleting custom modules in the FileCabinet and temporarily moving them locally. To bypass server side validation. After the successful deploy I uploaded the custom modules. In one case where this did not work, I simply removed all imports to the custom module instead of deleting it.