endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
819 stars 71 forks source link

SES evaluation fails #341

Closed MakMuftic closed 4 years ago

MakMuftic commented 4 years ago

I am unable to figure out why evaluation fails for this bundle.

Is it possible to get a more specific error message than this SyntaxError: Invalid or unexpected token (e.g. specific line number or something like this)?

SyntaxError: Invalid or unexpected token
    at Object.eval (eval at createScopedEvaluatorFactory (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/ses/dist/ses.cjs.js:1323:10), <anonymous>:8:30)
    at safeEvalOperation (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/ses/dist/ses.cjs.js:1388:16)
    at /home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/ses/dist/ses.cjs.js:1429:46
    at realmEvaluate (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/ses/dist/ses.cjs.js:1659:10)
    at callAndWrapError (eval at createUnsafeRec (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/ses/dist/ses.cjs.js:734:28), <anonymous>:33:14)
    at Realm.evaluate (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/ses/dist/ses.cjs.js:116:14)
    at snapEval (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/@nodefactory/snaps-cli/src/commands.js:200:22)
    at async build (/home/mak/Documents/repos/nf/metamask-snap-polkadot/node_modules/@nodefactory/snaps-cli/src/commands.js:69:5)
kriskowal commented 4 years ago

It might be helpful to use the new lockdown({errorTaming: 'unsafe'}) option. This lets errors carry stacks.

kriskowal commented 4 years ago

It looks like the related issue at MetaMask has resolved. I hope the suggestion above proves useful in the future. Please reopen if we can assist further, and my apologies for the latency on my response!