SignInWithMoralis() for firebase gives "Unexpected token 'export' "

Although I had the SignInWithMoralis() working with the firebase extension in next.js, I needed to reproduce a small working version and now I keep running into a new error that I cannot seem to solve. getMoralisAuth() returns an object, but when I run SignInWithMoralis I get this error:

SyntaxError: Unexpected token ‘export’
at […]\node_modules\ (moralisweb3\client-firebase-auth-utils\lib\index.js:1)

This is my code

import { getAuth } from 'firebase/auth';
import { getFunctions } from 'firebase/functions';
// import { getMoralisAuth } from '@moralisweb3/client-firebase-auth';
import { getMoralisAuth } from '@moralisweb3/client-firebase-auth-utils';
import { signInWithMoralis } from '@moralisweb3/client-firebase-evm-auth';
const firebaseConfig = {....
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const functions = getFunctions(app);
const moralisAuth = getMoralisAuth(app, {

async function signIn() {
await signInWithMoralis(moralisAuth);

Can you see what is wrong?

Issue seems to be with the latest version of @moralisweb3/client-firebase-auth, which was upgraded 3 days ago from 2.14.3 to to 2.16.1.

When downgrading to 2.14.3 I get no errors, although the signInWithMoralis() is still not working as intended. Now, the ext-moralis-auth-requestMessage function is invoked on cloud function, but the issueToken function is never invoked and no user is created in firebase.

I am not sure if this is a related error or a new one?

Hi @Va55

Are you seeing any other errors in the browser console or under network tab?