lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2k stars 43 forks source link

Error: 'Page Records cannot be deserialized' #586

Open alankleindev opened 8 months ago

alankleindev commented 8 months ago

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?

lukehaas commented 8 months ago

@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.

alankleindev commented 8 months ago

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.

lukehaas commented 8 months ago

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