Skip to content

new Object().constructor === Object returns false #899

Open
@fabian-hiller

Description

@fabian-hiller

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:

  1. Install Next.js
  2. Add export const runtime='edge' to page.tsx
  3. Add console.log(new Object().constructor === Object) to page.tsx
  4. Run next dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions