Skip to content

Fix cross-platform path handling in RSS feed generator - #8741

Open
ShakilUrRehman21 wants to merge 1 commit into
reactjs:mainfrom
ShakilUrRehman21:fix-rss-path-windows
Open

ShakilUrRehman21 wants to merge 1 commit into
reactjs:mainfrom
ShakilUrRehman21:fix-rss-path-windows

Conversation

@ShakilUrRehman21

Copy link
Copy Markdown
Contributor

Summary

In src/utils/rss.js, the slug generation logic relied on filePath.split('/'). On Windows environments where path.join produces backslash separators, split('/') does not split the path, resulting in the absolute machine filesystem path being baked into <link> and <guid> elements in public/rss.xml (e.g., https://react.dev/blog/D:\OpenSource\react.dev\src\content\blog\2026\09\09\react-19-3).

This PR:

  • Replaces POSIX-only path splitting with standard path.relative(dirPath, filePath) and forward-slash normalization.
  • Uses path.join(dirPath, file) in getAllFiles instead of string concatenation.

How was this tested?

  • Ran node scripts/generateRss.js locally.
  • Verified all 24 blog entries in public/rss.xml now generate valid permalinks (e.g. https://react.dev/blog/2026/09/09/react-19-3).
  • Verified zero backslashes or filesystem paths remain in the generated feed.
  • Ran yarn tsc and npx prettier --check src/utils/rss.js.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

This branch was successfully deployed

1 active deployment
Preview — 31277ef1 Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant