edge-runtime
edge-runtime copied to clipboard
Class is missing Function in prototype chain
The following fails in the edge runtime (but not in the node runtime)
class Foo {
constructor() {
...
}
...
}
const cls = Foo;
cls instanceof Function // true in node runtime, false in edge runtime
Encountered when using the Firebase Client SDK while initializing the auth module where it tries to discern if a passed argument is a class or not.
It seems all prototypes are broken. Just tried this now,
console.log(Object.prototype)
prints [Object: null prototype] {}
in Node, while the edge runtime returns just the empty object, {}
Hello @snystedt, can you add a reproduction of the issue?
It isn't clear it's related to Edge Runtime:
$ edge-runtime
ƒ => class Foo {}
ƒ => const cls = Foo
ƒ => const result = cls instanceof Function
ƒ => console.log(result)
true
is this a thing you are experiencing after deploy a Next.js project or a middleware via Vercel CLI?
I close it due to lack of information for now