`new Object().constructor === Object` returns `false`
Bug Report
new Object().constructor === Object returns false in Next.js with edge runtime enabled.
A clear and concise description of the behavior.
new Object().constructor === Object should return true.
A clear and concise description of what you expected to happen (or code).
new Object().constructor === Object should return true
Workaround: new Object().constructor === Object.prototype.constructor
With other objects like Date it works: new Date().constructor === Date returns true
Steps to reproduce:
- Install Next.js
- Add
export const runtime='edge'topage.tsx - Add
console.log(new Object().constructor === Object)topage.tsx - Run
next dev
Just ran into this too. Easier reproduction:
npx edge-runtime --eval "({}).constructor == Object" -> false
node --eval "console.log(({}).constructor == Object)" -> true
I think this is the root cause of this issue https://github.com/flightcontrolhq/superjson/issues/302, would appreciate an answer from the maintainers :)
+1