Skip to content
Merged
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/old-ladybugs-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vercel/remix-builder': patch
---

[remix] remove check based on never set remixRunVercelPkgJson
15 changes: 2 additions & 13 deletions packages/remix/src/build-vite.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFileSync, promises as fs, statSync, existsSync } from 'fs';
import { basename, dirname, join, relative, sep } from 'path';
import { basename, dirname, join, relative } from 'path';
import { isErrnoException } from '@vercel/error-utils';
import { nodeFileTrace, NodeFileTraceOptions } from '@vercel/nft';
import {
Expand All @@ -13,7 +13,6 @@ import {
runNpmInstall,
runPackageJsonScript,
scanParentDirs,
FileBlob,
FileFsRef,
EdgeFunction,
NodejsLambda,
Expand Down Expand Up @@ -635,8 +634,6 @@ async function createRenderEdgeFunction(
);
}

let remixRunVercelPkgJson: string | undefined;

// Trace the handler with `@vercel/nft`
const trace = await nodeFileTrace([handlerPath], {
base: rootDir,
Expand All @@ -648,15 +645,7 @@ async function createRenderEdgeFunction(
logNftWarnings(trace.warnings, '@remix-run/server-runtime');

for (const file of trace.fileList) {
if (
remixRunVercelPkgJson &&
file.endsWith(`@remix-run${sep}vercel${sep}package.json`)
) {
// Use the modified `@remix-run/vercel` package.json which contains "browser" field
files[file] = new FileBlob({ data: remixRunVercelPkgJson });
} else {
files[file] = await FileFsRef.fromFsPath({ fsPath: join(rootDir, file) });
}
files[file] = await FileFsRef.fromFsPath({ fsPath: join(rootDir, file) });
}

const fn = new EdgeFunction({
Expand Down