Hi Guys, Wondering if anyone can help me with a @N...
# suitescript
p
Hi Guys, Wondering if anyone can help me with a @NamdConfig problem. For some reasons it seems like my paths aren’t working. Script file (another lib file):
Copy code
* @NApiVersion 2.1
* @NAmdConfig /SuiteScripts/config.json
and from define:
Copy code
'N/record','N/format','sh','N/search',...
config.json:
Copy code
{
  "paths": {
    "sh": "/SuiteScripts/lib/searchHelper",
    "createJournal": "/SuiteScripts/lib/createJournal",
    "formBuilder": "/SuiteScripts/lib/formBuilder"
  }
}
Results in {“type”“error.SuiteScriptModuleLoaderError”,“name”“MODULE_DOES_NOT_EXIST”,“message”:“Module does not exist: /sh.js”,“stack”:[]} I’m having a hard time understanding why this happens, can it be 2.1 related?
b
use absolute paths
your module id is being interpreted as a relative path
p
Yeah I get that, I have no problem doing instead of “sh” doing “/Suitescripts/lib/<sh>” the issue is that we have a fairly large project and would be very beneficial if we could alias different modules hence me sitting with the @NamdConfig
b
whats the absolute path to sh.js?
p
it is: /Suitescripts/lib/searchHelper.js
tried with or without “.js” in the path
b
assuming you havent done something weird with Suitescripts vs SuiteScripts
ive tried amd config on 2.1 and it still works normally
sorry, ive read your question and missed that you were doing this in another library file
you need the amd config at the script entry point
weird stuff happens when you place amd config outside of the entry point
p
@battk, great tip I’ll try
unfortunately still stuck
b
You would probably need to share enough for me to make the matching scripts dependencies
I dont really want all the script, basically enough to recreate the define dependencies