From f6ed77b12a7f05224aa45430f95fc08722ae0dca Mon Sep 17 00:00:00 2001 From: Yuanlin Lin Date: Tue, 19 Sep 2023 12:12:33 +0800 Subject: [PATCH] fix(lib): Fix `package.json` not found error for Next.js serverless --- internal/nodejs/nextjs/function.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/nodejs/nextjs/function.go b/internal/nodejs/nextjs/function.go index 052aad33..3dd104f5 100644 --- a/internal/nodejs/nextjs/function.go +++ b/internal/nodejs/nextjs/function.go @@ -35,7 +35,7 @@ func constructNextFunction(zeaburOutputDir, firstFuncPage, tmpDir string) error return fmt.Errorf("copy .next: %w", err) } - err = cp.Copy("package.json", path.Join(p, "package.json")) + err = cp.Copy(path.Join(tmpDir, "package.json"), path.Join(p, "package.json")) if err != nil { return fmt.Errorf("copy package.json: %w", err) }