Compare commits

..

1 Commits

Author SHA1 Message Date
TheodorTomas
6782bef7e1 fix: replace @vercel/og with next/og 2026-02-05 16:31:36 +08:00
2 changed files with 3 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
import { ImageResponse } from "@vercel/og";
import { ImageResponse } from "next/og";
import { NextRequest } from "next/server";
export const GET = async (req: NextRequest) => {

View File

@@ -56,25 +56,9 @@ export const CustomScriptsInjector = ({
newScript.setAttribute(attr.name, attr.value);
});
// Copy inline script content with error handling
// Copy inline script content
if (script.textContent) {
// Wrap inline scripts in try-catch to prevent user script errors from breaking the survey
newScript.textContent = `
(function() {
try {
${script.textContent}
} catch (error) {
console.warn('[Formbricks] Error in custom script:', error);
}
})();
`.trim();
}
// Add error handler for external scripts
if (script.src) {
newScript.onerror = (error) => {
console.warn("[Formbricks] Error loading external script:", script.src, error);
};
newScript.textContent = script.textContent;
}
document.head.appendChild(newScript);