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' to page.tsx
- Add
console.log(new Object().constructor === Object) to page.tsx
- Run
next dev
Bug Report
new Object().constructor === Objectreturnsfalsein Next.js with edge runtime enabled.A clear and concise description of the behavior.
new Object().constructor === Objectshould returntrue.A clear and concise description of what you expected to happen (or code).
new Object().constructor === Objectshould returntrueWorkaround:
new Object().constructor === Object.prototype.constructorWith other objects like
Dateit works:new Date().constructor === DatereturnstrueSteps to reproduce:
export const runtime='edge'topage.tsxconsole.log(new Object().constructor === Object)topage.tsxnext dev