fix: /api/js endpoint to work on vercel (#2242)

This commit is contained in:
Shubham Palriwala
2024-03-19 15:16:09 +05:30
committed by GitHub
parent 6c84850a7e
commit 4abe080db2
2 changed files with 4 additions and 2 deletions

View File

@@ -74,6 +74,5 @@ async function handleInit(req: NextRequest) {
async function loadAndAppendCode(path: string, append: string): Promise<string> {
let jsCode = await fs.readFile(path, "utf-8");
return jsCode + append;
}

View File

@@ -1,7 +1,7 @@
import { fileURLToPath } from "node:url";
import { createId } from "@paralleldrive/cuid2";
import { withSentryConfig } from "@sentry/nextjs";
import createJiti from "jiti";
import { fileURLToPath } from "node:url";
const jiti = createJiti(fileURLToPath(import.meta.url));
@@ -20,6 +20,9 @@ const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["@aws-sdk"],
instrumentationHook: true,
outputFileTracingIncludes: {
"app/api/js": ["../../packages/**/*"],
},
},
transpilePackages: ["@formbricks/database", "@formbricks/ee", "@formbricks/ui", "@formbricks/lib"],
images: {