"Error: Missing an Atlas App Services app-id"

I’m getting this error from the browser when I try to call a function

Here is the key code

import * as Realm from "realm-web";
const _realmAppConfig = { id: import.meta.env.REALMAPP, ATLAS_APP_ID: import.meta.env.REALMAPP }
const credentials = Realm.Credentials.emailPassword(import.meta.env.REALMAPPUSER, import.meta.env.REALMAPPPSW)
export async function AddTag(tag: string) {
    const app = new Realm.App(_realmAppConfig);
    const user = await app.logIn(credentials);
    const res = await user.callFunction("AddTag", tag)
    return res
}

Whenever I call AddTag I get this error: “Error: Missing an Atlas App Services app-id”

Please help