You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// index.mjs
import { EdgeRuntime } from 'edge-runtime'
const main = async () => {
try {
const runtime = new EdgeRuntime();
runtime.evaluate(`
const a = Object.create({})
console.log('a --> ', a);
const b = Object.create(null)
console.log('b --> ', b);
`);
} catch(err) {
console.log(`evaluate error: `, err);
}
}
main();
executing node ./index.mjs, you can see the error in terminal:
evaluate error: evalmachine.<anonymous>:124
var getConstructorName = /* @__PURE__ */ __name((object) => object.constructor.name, "getConstructorName");
TypeError: Cannot read properties of undefined (reading 'name')
at getConstructorName (evalmachine.<anonymous>:124:84)
at formatRaw (evalmachine.<anonymous>:229:29)
at formatValue (evalmachine.<anonymous>:224:16)
at inspect (evalmachine.<anonymous>:346:16)
at format (evalmachine.<anonymous>:196:26)
at Object.log (evalmachine.<anonymous>:571:55)
at evalmachine.<anonymous>:5:15
Expected
console.log should work successfully on objects with null prototype as it does in the browser.
Environments
node: v16.15.1
edge-runtime: 1.1.0-beta.31
The text was updated successfully, but these errors were encountered:
Step to reproduce:
index.mjs
:node ./index.mjs
, you can see the error in terminal:Expected
console.log
should work successfully on objects with null prototype as it does in the browser.Environments
The text was updated successfully, but these errors were encountered: