Vercel CLI build for Remix fails on Windows because of ':'(colon) in path
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 16.3k
- Forks
- 3.8k
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Remix treats a dynamic route parameter as a :-prefixed segment in path as in foo/:bar.
When vercel build, writeLambda() creates a symbolic link on that path but Windows doesn't permit : in filename, so it fails:
Error: ENOENT: no such file or directory, symlink '..\404.func' -> 'path-to-project\.vercel\output\functions\foo\:bar.func'
The simplest solution might be:
// before
const dest = join(outputDir, 'functions', `${path}.func`);
// after
const dest = join(outputDir, 'functions', `${process.platform === 'win32' ? path.replace(':', '$') : path}.func`);
but it has too much overhead for other irrelevant cases.
Hope it'be solved seamlessly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/cli/src/util/build/write-build-result.ts at writeLambda(), where the function output path is assembled. Reproduce the Windows vercel build failure for a dynamic route containing a colon, then verify that the generated function path uses a Windows-safe representation and that the build completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100