-
Notifications
You must be signed in to change notification settings - Fork 60
Sitemap XML generator - fix runtime setting #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- fix runtime setting
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes in this pull request involve modifying the export configuration for the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint (1.23.1)
src/app/api/generator/sitemap-xml/route.jsOops! Something went wrong! :( ESLint: 9.15.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
src/app/api/generator/sitemap-xml/route.js (2)
Line range hint
40-42: Fix incorrect error variable reference in catch blockThere's a critical bug in the error handling. The catch block uses parameter
ebut references an undefinederrorvariable in the error message construction. This will cause a ReferenceError.Apply this fix:
} catch (e) { controller.error( - new Error("Failed to generate sitemap: " + error.message), + new Error("Failed to generate sitemap: " + e.message), ); }
Line range hint
12-53: Add tests for sitemap generation endpointThe PR checklist indicates no new tests were added. Given this is a critical SEO-related endpoint with complex stream handling and error scenarios, it should have comprehensive test coverage.
Would you like me to help create test cases covering:
- Valid URL handling
- Invalid URL scenarios
- Stream generation success
- Error handling scenarios
- Edge runtime compatibility
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/app/api/generator/sitemap-xml/route.js(1 hunks)
🔇 Additional comments (1)
src/app/api/generator/sitemap-xml/route.js (1)
5-5: LGTM! Runtime configuration follows Next.js App Router conventions.
The direct export of runtime = "edge" is the correct way to configure edge runtime in Next.js App Router.
Let's verify this is a Next.js App Router API route:
✅ Verification successful
LGTM! Runtime configuration follows Next.js App Router conventions.
The file is correctly structured as a Next.js App Router API route with:
- Proper route.js naming in the app directory structure
- Next.js imports (next/server)
- Standard route handler export (GET)
- Correct edge runtime configuration using direct export
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Verify this is within the App Router structure and no other runtime configurations exist
fd "route.js" "src/app" --exec grep -l "runtime"
Length of output: 87
Script:
#!/bin/bash
# Let's verify the file structure and content to ensure it's a Next.js App Router API route
cat src/app/api/generator/sitemap-xml/route.js
Length of output: 1383
|
Hi @Bashamega just an update to correctly set edge runtime for the EP. Vercel's Edge runtime doesn't have an execution timeout. |
Description
Fix setting edge runtime for EP that is generating sitemap.
Fixes #108
Type of change
Checklist:
Screenshots (if applicable):
Summary by CodeRabbit
Bug Fixes
Chores