Any idea why I'm experiencing this issue when tryi...
# suitescript
c
Any idea why I'm experiencing this issue when trying to add dropbox library on my client script?
Copy code
Fail to evaluate script: {"type":"error.SuiteScriptModuleLoaderError","name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /node-fetch.js","stack":["(/SuiteScripts/dropboxtest/Library/dropbox/Dropbox-sdk.min.js:1)"]}
w
@battk simple to implement in a suitescript?
b
for this particular question, the answer is to only require the module clientside
c
@battk sorry can you clarify? What do you mean by requiring the module only for clientside?
b
netsuite evaluates your code serverside (to tell which entry points you use)
serverside code doesnt have a window global, so the library tries to require node-fetch, which also doesnt exist
instead, use the require in an if condition to only require the code when the window global exists