This message was deleted.
# suitescript
s
This message was deleted.
s
you may want to post your main script - the error suggests NS doesn't think you are exporting the necessary stuff from that script.
t
I’m not sure if this means anything to you, but when I remove either of the custom scripts from the Map/Reduce parameters, I can save it without issue
s
it is notable that
@NAmdConfig
only works at the top level script, so if you're needing that any deeper (i.e. in a lib) it will break.
try removing the
@Nxxx
tags from your libraries
t
I removed the tags from both libraries but I’m still running into the issue. I’m not sure if it makes a difference, but I am referencing the same library in both my Map/Reduce script and in one of my library files
s
I can say I do this on every script (have libraries and/or libraries that refer to other libraries).
t
Ok so it’s safe to assume that isn’t what’s causing the problem then. Very interesting
I wonder if it’s possible that a path to one of the library files isn’t correct?
It doesn’t appear that is the issue after double checking
s
you may want to ensure your library script files are proper syntax
and have no side-effects (i.e. avoid executing code just by loading the module)
t
It seems to me that everything is fine in the scripts
c
empty the map reduce script contents, then upload and create the record, then add the code back in for the libraries via upload
This isn't unique to 2.1 it does this in 2.0 too in the past. There's some preprocessor bug they have in their stuff
t
I’m not sure I totally understood the steps - let me repeat what I did: 1. I deleted the existing MR script record 2. I removed the links to the library files within the MR script and uploaded the new file to the file cabinet 3. I created a new MR script record 4. I re-added the library links to the MR file and re-uploaded the MR file to the file cabinet, replacing the existing one When I did this, I ran into the same error. Did I misunderstand the steps?
c
In the actual map/reduce record code (getInput data/map/reduce/summarize), delete the code from there, then upload the "empty" map/reduce script. Itll let you create the record without throwing errors. Then, once the script records are created, upload the actual code and libraries.
1. Make "dummy" map/reduce script and record/deployment with nothing in it 2. Upload actual scripts to overwrite... since the record is already created, you shouldn't get the entry point errors
t
Thanks Chris! I’ll give that a try now
c
sure
t
I seem to be running into the same error still
I feel like this is going to turn out to be an incredibly dumb error and I’m going to kick myself when I figure it out
c
which step is it throwing the error on
uploading throws the error or creating the script record throws the error
t
uploading with the code back in the file
s
I haven't seen that erroneous-validation-problem lately.
It would probably help to post the code, unless it's secret.
t
I’ll scrub the code and then post that - one minute
c
is 2.1 turned on in the account by chance? as a sanity check
t
Yup!
b
what kind of monster has multiple lib directories
t
one is a constants file 🙂
c
When you uploaded the "scrubbed script" is it what you have here? as the MR? if so, thats not what im talking about
Copy code
/**
 *
 * @NApiVersion 2.1
 * @NScriptType MapReduceScript
 * @NModuleScope SameAccount
 */
define([], function () {

    function getInputData(context) {
        
    }

    function map(context) {
        
    }

    function reduce(context) {
       
    }

    function summarize(context) {
        
    }

    return {
        getInputData: getInputData,
        map: map,
        reduce: reduce,
        summarize: summarize
    };
});
If you can get this uploaded and a script record created, you should be able to upload whatever
@stalbert it may not be the issue but i'm pretty sure it is. I've run into this a ton in the past and it was this weird pre-processor error. So unless its now a new error, this SHOULD fix it.
s
I agree with @creece - upload that skeleton script he shows above, THEN reupload your 'real' script.
t
The scrubbed mr was after putting the code back in. I uploaded the empty file (basically what you just posted), and created the script record without any issue. It was when I tried to reupload the real MR that I got the same error again
s
This used to be a huge PITA for me as I had to always create a skeleton script like above first.
I think using multiple libs makes you a good candidate for TypeScript - there may be something going on that the TS compiler would tell you.
b
were you consistent in the naming of your modules in your scrubbed files?
t
I was not - I octuple checked the actual scripts and all the module names were correct though
b
didnt use sdf
might want to try deleting everything and starting over
structure ended up looking like
script predictably fails in getInputData because
record
is not a real search type
c
ive never had an incorrect record type fail a script during upload it usually fails when you create the search
is this new?
b
i ran it
c
yeah it'll fail for sure when you run it but it shouldn't stop it from uploading and giving the entry point error.
b
screenshot shows the successfully created script record
no problems there
c
yeah probably need to start over then and delete if thats the case
b
if it still fails, you deleted your problem from the scrubbed files
or potentially you somehow messed up lodash
t
Definitely not lodash as I’ve used that exact file in multiple scripts. I’ll try deleting everything tomorrow and see how it goes. Thanks to everyone for your time and input!
I fixed the issue. I removed the library reference from the other library record, which then allowed me to update the MR script. I then updated the library script with the library reference and now I can update the MR without issue. Thanks NetSuite!
s
strange, but glad you got it working!