Hey,
I am trying to create a serverless app that communicates with our system using our API.
The error I am getting after uploading and installing the custom app is:
{
"requestID":"5b2a9fe3-6162-4bd9-bf63-59306164fc1d",
"status":500,
"message":"Error while executing App server script! - Cannot find module './developer/node_modules/http'",
"errorSource":"APP"
}
Dependencies in my manifest file look like this:
"dependencies": {
"ntlm": "0.1.3",
"request": "2.88.0",
"http": "0.0.0"
}
I am using request to make the actual request and ntlm for authentication. I also tried to add http here but that does not seem to solve my issue.
As for my code:
- I am using require as follows:
const ntlm = require('ntlm');
const http = require('http');
const request = require('request');Again I tried to add http here, but I was getting the error without this line as well.
- I am using an http agent as this was the only way I was able to make the ntlm authentication work.
let ntlmrequest = request.defaults({
agent: request.http.Agent({
keepAlive: true,
maxSockets: 1,
keepAliveMsecs: 3000,
}),
}); - My app exports 2 functions which I then invoke in the frontend part of my app after app.initialized() function. The first function is a bit more complicated, but the other one is really simple:
test: args => renderData(null, args)
yet still returns the same error.
I am using "Bash on Ubuntu on Windows" to pack the app. Node version 6.14.4 and fdk version 4.4.1.