Skip to content
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

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

Open
rezelute opened this issue Feb 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rezelute
Copy link

rezelute commented Feb 6, 2025

🐛 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

<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/[email protected]/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

@rezelute rezelute added the bug Something isn't working label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant