diff --git a/v2/src/plugins/codeTypeChecking/index.js b/v2/src/plugins/codeTypeChecking/index.js index 71d5c49d6..b4201749c 100644 --- a/v2/src/plugins/codeTypeChecking/index.js +++ b/v2/src/plugins/codeTypeChecking/index.js @@ -612,7 +612,12 @@ function replaceCustomPlaceholdersInLine(child, exportedVariables) { * For snippets that contain supertokensUIInit, we add the dic id param parameter */ if (line.includes("supertokensUIInit(")) { - line = line.split("supertokensUIInit(").join("supertokensUIInit(\"supertokensui\", "); + line = line.split("supertokensUIInit(").join("(window as any).supertokensUIInit(\"supertokensui\", "); + newLines.push(line); + continue; + } + if (line.includes("supertokensUI") && !line.includes("supertokens-auth-react-script")) { + line = line.split("supertokensUI").join("(window as any).supertokensUI"); newLines.push(line); continue; }