Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/frank-camels-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@next-community/adapter-vercel": patch
---

Fix assetHash key of the launcher
19 changes: 7 additions & 12 deletions packages/adapter/src/outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ export async function handleNodeOutputs(

const fsSema = new Sema(16, { capacity: nodeOutputs.length });
const functionsDir = path.join(vercelOutputDir, 'functions');
const handlerRelativeDir = path.posix.relative(repoRoot, projectDir);

let pages404Output: undefined | FuncOutputs[0];
let pagesErrorOutput: undefined | FuncOutputs[0];
Expand Down Expand Up @@ -533,23 +532,22 @@ export async function handleNodeOutputs(
filesHashes[routesManifestRelativePath] = routesManifestHash;
}

const handlerFilePath = path.join(
functionDir,
handlerRelativeDir,
const handlerRelativePath = path.posix.join(
path.posix.relative(repoRoot, projectDir),
'___next_launcher.cjs'
);

await fs.mkdir(path.dirname(handlerFilePath), { recursive: true });
const handlerAbsolutePath = path.join(functionDir, handlerRelativePath);
await fs.mkdir(path.dirname(handlerAbsolutePath), { recursive: true });
const handlerSource = getHandlerSource({
projectRelativeDistDir: path.posix.relative(projectDir, distDir),
prerenderFallbackFalseMap,
isMiddleware,
nextConfig: config,
nextEnvLoaderPathRelativeToProjectDir,
});
await writeIfNotExists(handlerFilePath, handlerSource);
await writeIfNotExists(handlerAbsolutePath, handlerSource);
if (filesHashes) {
filesHashes['___next_launcher.cjs'] = sha256(handlerSource);
filesHashes[handlerRelativePath] = sha256(handlerSource);
}

const operationType =
Expand Down Expand Up @@ -590,10 +588,7 @@ export async function handleNodeOutputs(
slug: 'nextjs',
version: nextVersion,
},
handler: path.posix.join(
path.posix.relative(repoRoot, projectDir),
'___next_launcher.cjs'
),
handler: handlerRelativePath,
runtime: nodeVersion.runtime,
maxDuration,
supportsMultiPayloads: true,
Expand Down
Loading