RunJS icon indicating copy to clipboard operation
RunJS copied to clipboard

Error: 'Page Records cannot be deserialized'

Open alankleindev opened this issue 1 year ago • 4 comments

I am able to run the below code outside of runjS using the the same version of Node but within runJS, I get the following error:

Error: 'Page Records cannot be deserialized'

const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

client.taskrouter.v1.workspaces('WS....')
                    .workers
                    .list({limit: 20})
                    .then(workers => {
                      workers.forEach(w => console.log(w.sid))
}).catch(err => {
  console.log(err);
});

It uses the Twilio Helper Library, 4.19.0.

Any suggestions?

alankleindev avatar Oct 30 '23 18:10 alankleindev

@alankleindev some of the advanced RunJS settings and also the build settings have an effect on the way it runs code. You could try toggling them and see if it makes a difference.

lukehaas avatar Oct 31 '23 11:10 lukehaas

I tried toggling some settings under build, but didn't have any luck, same error: "Error: 'Page Records cannot be deserialized'".

It is not a show stopper, I was just curious why I was seeing different behavior.

alankleindev avatar Oct 31 '23 19:10 alankleindev

The error is coming from the library, so it's hard for me to say what's causing it. Maybe if you take a look at the source there will be some clues: https://github.com/twilio/twilio-node/blob/de635412136f0ea776fc0223a6235f249e2a5a0b/src/base/Page.ts#L253

lukehaas avatar Nov 01 '23 09:11 lukehaas