We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Object().constructor === Object
false
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.
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
new Object().constructor === Object.prototype.constructor
With other objects like Date it works: new Date().constructor === Date returns true
Date
new Date().constructor === Date
Steps to reproduce:
export const runtime='edge'
page.tsx
console.log(new Object().constructor === Object)
next dev
The text was updated successfully, but these errors were encountered:
Invalid type: Expected Object but received Object
edge
Just ran into this too. Easier reproduction:
npx edge-runtime --eval "({}).constructor == Object" -> false node --eval "console.log(({}).constructor == Object)" -> true
npx edge-runtime --eval "({}).constructor == Object"
node --eval "console.log(({}).constructor == Object)"
Sorry, something went wrong.
I think this is the root cause of this issue flightcontrolhq/superjson#302, would appreciate an answer from the maintainers :)
No branches or pull requests
Bug Report
new Object().constructor === Object
returnsfalse
in Next.js with edge runtime enabled.A clear and concise description of the behavior.
new Object().constructor === Object
should returntrue
.A clear and concise description of what you expected to happen (or code).
new Object().constructor === Object
should returntrue
Workaround:
new Object().constructor === Object.prototype.constructor
With other objects like
Date
it works:new Date().constructor === Date
returnstrue
Steps to reproduce:
export const runtime='edge'
topage.tsx
console.log(new Object().constructor === Object)
topage.tsx
next dev
The text was updated successfully, but these errors were encountered: