Error trying to load the supertokensui signup/in component in Vue (using Docs)

Author: rezeluteCreated Feb 6, 2025Updated Apr 24, 2025
Labelsbug

Bug Report

I followed to docs here while setting up a very basic Vue 3 application: https://supertokens.com/docs/quickstart/frontend-setup, but i just get the following console error which is coming from: init genericComponentOverrideContext.js:1339 Uncaught TypeError: n is undefined

bash
<template>
   <div id="supertokensui" />
</template>

<script lang="ts">
import { defineComponent, onMounted, onUnmounted } from "vue";
export default defineComponent({
   setup() {
      const loadScript = (src: string) => {
         const script = document.createElement("script");
         script.type = "text/javascript";
         script.src = src;
         script.id = "supertokens-script";
         script.onload = () => {
            supertokensUIInit({
               appInfo: {
                  appName: "Auth App",
                  apiDomain: "my-api-domain",
                  websiteDomain: "my-app-domain",
                  apiBasePath: "/auth",
                  websiteBasePath: "/auth",
               },
               recipeList: [supertokensUIEmailPassword.init(), supertokensUISession.init()],
            });
         };
         document.body.appendChild(script);
      };

      onMounted(() => {
         loadScript("https://cdn.jsdelivr.net/gh/supertokens/prebuiltui@v0.48.0/build/static/js/main.81589a39.js");
      });

      onUnmounted(() => {
         const script = document.getElementById("supertokens-script");
         if (script) {
            script.remove();
         }
      });
   },
});
</script>

I then tried to follow the docs for the Custom UI and there is a piece of code missing here: "After that, call the following function when the user submits the form that you have previously created."

Image

Source: supertokens/supertokens-core