-
Notifications
You must be signed in to change notification settings - Fork 370
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
Farmhash-modern throws webassembly error in Nextjs #2627
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Does configuring webpack by setting module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.experiments = {
asyncWebAssembly: true,
};
return config;
},
}; |
I'm getting the same issue.. This code does seem to "fix" the issue, but
|
Experiencing the same issue. For now, I followed the workaround at #2552 (comment), which is to downgrade to Credits to @chandrasekhar2039 |
Downgrading to 12.0.0 did not work for me.
|
I also tried this, but as @Keegan-lee said |
I am experiencing the same exact issue. Workaround Also, using Edit: use |
Am having the same problem here, searched the best i could and it seems that there is no direct solution yet... The best that i had saw is utilize another lib called next-firebase-auth-edge (https://github.com/awinogrodzki/next-firebase-auth-edge) |
I am guessing that Firebase Auth cannot be used on Edge runtime due to the need for some Node-only modules. |
Hey Guys, |
You shouldn’t get the error, the package should be able to smoothly run on all NextJS environments. I however renew my suggestion of being cautious when using the package |
Are you sure? I see plenty of people complaining about the same thing (that it won't work when using middleware). I'm using firestore and admin (but not auth) from firebase-admin and it leads to that error. |
How are you importing the library? Also, yes I am sure, as per the documentation of the package:
|
Here is my middleware,
and here is the stack trace,
and here is the content of firebase-init.ts file:
|
updated my response above. |
As pointed out earlier, Firebase seems to work only in the Node server. // /api/auth/session export async function GET(_request: Request){ // middleware.ts console.log(isAuthenticated) const respond = NextResponse.next() return respond |
First of all, I suggest that you all try to format the code in the thread correctly. You can do so via backticks. @hassanzadeh I can't test your code right now, but the issue might lie in the fact that you are still using @brouza Seems like an okay workaround as far as I'm concerned; you could even try using a server action to abstract away the REST paradigm. I would at least try to secure the endpoint, however, even though it's a server-to-server communication. There might be more security implications as well. I am as well awaiting an official response regarding this issue. |
Thanks @nicolopadovan , |
Thanks, I first need to know why my current code is not working especially that I'm not using firebase-admin auht at all. |
Ok, I think you are right. |
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
I'm trying to configure firebase-admin SDK on my nextjs + TS project. Whenever i try to invoke any SDK function, i get a webAssembly error. In my case, i am trying to configure a middleware for the server side api, and when i call the verifyIdToken method it throws the error. I'll paste it below, i also noticed that the affected dependency
farmhash-modern
was just replaced in this version of firebase.Steps to reproduce:
The error occured when i called the
verifyIdToken()
method in mymiddleware.ts
file.Relevant Code:
This is the middleware file.
This is the error output
This question is also on stackoverflow
The text was updated successfully, but these errors were encountered: