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, {
auth,
functions,
});
console.log(moralisAuth);
async function signIn() {
await signInWithMoralis(moralisAuth);
}
Can you see what is wrong?