Repository navigation
fix(core): avoid Yarn Classic Windows tar-extraction bug dropping src/pages/s.tsx - #3486
Conversation
…/pages/s.tsx Yarn Classic 1.x silently drops the `src/pages/s.tsx` tar entry when extracting @faststore/core on Windows — every other page under `src/pages/` survives, only this single-character-named file vanishes before `next build` even starts type-checking. It then fails deep inside Next.js's TypeScript check with a misleading "Cannot find module 'src/pages/s'" error, coming from an unrelated bare import in PageProvider.tsx/SearchPage.tsx/SearchWrapper.tsx. Confirmed root cause: extracting the exact same @faststore/core tarball with Windows' own tar.exe keeps the file; yarn install drops it. The bug is in Yarn's own extraction implementation, not ours. Move the file to `src/pages/s/index.tsx` (Next.js treats a folder + index.tsx identically to a bare page file — same /s route, same content), which changes the tar-entry shape enough to avoid the bug. Update the one place in @faststore/cli that hardcoded the old path (enableSearchSSR) and add a regression assertion to the existing copyCoreFiles test. The public /s route and its exported types are unchanged; only the on-disk source path moved. Co-authored-by: Cursor <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: vtex/faststore/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. WalkthroughThe CLI now targets ChangesSearch page path
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The search page retains its 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Lint check on #3486 failed: the regression assertion I added wrapped across lines when it fits Biome's 80-char width on one line. Co-authored-by: Cursor <[email protected]>
@faststore/api
@faststore/cli
@faststore/components
@faststore/core
@faststore/diagnostics
@faststore/lighthouse
@faststore/sdk
@faststore/ui
commit: |
DK Review — Audit SummaryVerdict: ✅ CLEAN
Only BLOCK and RESTRICT findings anchored to a changed line are commented inline on the diff. The finding below opens no review thread. Scenarios evaluated: feature-flags, general-review, quality-ratchet 📋 Findings (1)SUGGEST
DK Review v1.0.0 | To dismiss a finding: reply |
The note asserted a mechanism ('changes the tar-entry shape enough to
avoid it') that the investigation did not establish. The controlled
test isolates Yarn's extractor as where the file is lost, but not why
it drops this entry, so state that openly and link the PR holding the
investigation and the before/after Windows CI runs.
Also keep the explanation in one place: the copyCoreFiles regression
guard now points at the page note instead of restating it, so the two
copies cannot drift.
Co-authored-by: Cursor <[email protected]>
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
What
Moves
packages/core/src/pages/s.tsxtopackages/core/src/pages/s/index.tsx(same/sroute, same content — Next.js treats a folder +index.tsxidentically to a bare page file), and updates the one hardcoded reference to the old path in@faststore/cli'senableSearchSSR.Why
Discovered while stabilizing the new Windows CI job in #3450:
Build starterwas failing deep inside Next.js's TypeScript check with a misleading error:Root-caused by turning the Windows CI runner itself into the repro environment (no local Windows machine available):
packages/core/src/pages/s.tsxis a real, legitimate file (the/ssearch route) — not a truncated path..faststore/src/pages/s.tsxwas missing from the generated storefront on Windows, while every sibling page file (404.tsx,500.tsx,_app.tsx,index.tsx,login.tsx,pvt/, etc.) copied fine.node_modules/@faststore/core/src/pages/right afteryarn install— i.e. it never survives extraction of the@faststore/coretarball.tar.exekeeps the file;yarn install(Yarn Classic 1.22.19) drops it. Same runner, same archive, different outcome — the bug is in Yarn's own extraction implementation on Windows, not in our packing, copying, or TypeScript config.s/index.tsx(identical route, different tar-entry shape) survives Yarn's extraction and the full WindowsBuild starterstep passes end to end, including the/sroute showing up correctly in the build output.Testing
copyCoreFilestest inpackages/cli/src/utils/generate.test.tsassertingsrc/pages/s/index.tsxexists and the oldsrc/pages/s.tsxpath does not.CLI + starter (Windows)) before and after this change — failing beforehand with the exact "Cannot find module" error, passing afterward with/sbuilt successfully.s.tsx.Scope note
This does not fix Yarn Classic's underlying bug (out of our control — it's upstream). It works around it for our own published package so Windows users on Yarn 1.x aren't affected.
Made with Cursor
Summary by CodeRabbit