Skip to content

Conversation

@Karibash
Copy link
Contributor

@Karibash Karibash commented Dec 8, 2025

Summary

If locales is not set in the config, getLangs returns an empty array.
As a result, llms.txt was not being generated.

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 8, 2025 13:53
@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit df15a73
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/6936d8635ec18c000828550b
😎 Deploy Preview https://deploy-preview-2866--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where llms.txt was not generated when locales was not configured. The fix ensures that the default language is always included in the list of languages to generate llms.txt files for, even when no additional locales are configured.

Key Changes:

  • Creates a Set containing both the default language and all configured languages
  • Uses this Set to ensure at least the default language is processed when generating llms.txt files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const langs = new Set([defaultLang, ...routeService.getLangs()]);
await Promise.all(
routeService.getLangs().map(async lang => {
langs.values().map(async lang => {
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Set.values() method returns an iterator, not an array. The .map() method cannot be called directly on an iterator. This will cause a runtime error.

To fix this, you should convert the Set to an array first:

await Promise.all(
  Array.from(langs).map(async lang => {

Alternatively, you could use:

await Promise.all(
  [...langs].map(async lang => {
Suggested change
langs.values().map(async lang => {
[...langs].map(async lang => {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant