Skip to content
New issue

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

Class is missing Function in prototype chain #89

Closed
snystedt opened this issue Aug 14, 2022 · 3 comments
Closed

Class is missing Function in prototype chain #89

snystedt opened this issue Aug 14, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@snystedt
Copy link

snystedt commented Aug 14, 2022

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.

@snystedt snystedt changed the title Class is missing Function in property chain Class is missing Function in prototype chain Aug 14, 2022
@javivelasco javivelasco added the bug Something isn't working label Aug 16, 2022
@snystedt
Copy link
Author

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, {}

@Kikobeats
Copy link
Member

Kikobeats commented Nov 2, 2022

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?

@Kikobeats
Copy link
Member

I close it due to lack of information for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants