-
Notifications
You must be signed in to change notification settings - Fork 431
web: attempt to fix 500 error in prod #1703
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
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Rate limit exceeded@yujonglee has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 21 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughRemove a VSCode explorer setting, add a Netlify functions directory entry in the web app config, remove an inline Netlify edge-function export and adjust lint/JSX directives in the OG edge function, and reorder the Netlify plugin after viteReact in the Vite config. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6eaf899 to
11db18f
Compare
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
🧹 Nitpick comments (1)
apps/web/vite.config.ts (1)
32-32: Document the reason for the Netlify plugin reordering.The Netlify plugin has been moved to execute after
viteReact(). Plugin order in Vite affects build and transform behavior, and this change could be critical to fixing the 500 error. Consider adding a comment explaining why this specific order is required to prevent future regressions.viteReact(), + // Netlify plugin must run after viteReact to ensure proper React JSX transformation netlify({ dev: { images: { enabled: true } } }),
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.vscode/settings.json(0 hunks)apps/web/netlify.toml(1 hunks)apps/web/netlify/edge-functions/og.tsx(1 hunks)apps/web/vite.config.ts(1 hunks)
💤 Files with no reviewable changes (1)
- .vscode/settings.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Redirect rules - hyprnote
- GitHub Check: Header rules - hyprnote
- GitHub Check: Pages changed - hyprnote
- GitHub Check: fmt
🔇 Additional comments (4)
apps/web/netlify.toml (3)
5-6: Confirm edge_functions path is correct relative to base directory.With
base = "/", theedge_functions = "apps/web/netlify/edge-functions"path should be validated. According to Netlify documentation, the edge_functions path is relative to the base directory. Ensure this path correctly points to theog.tsxfile that's being fixed in this PR.The explicit edge_functions directory configuration should help Netlify locate the edge function correctly, which may resolve the 500 error.
9-11: LGTM: Functions directory configuration.The explicit functions directory configuration follows Netlify's documentation and should help ensure proper deployment of serverless functions.
2-3: The base and package configuration is correct for a pnpm monorepo setup.In monorepos, the base directory should remain at the repository root so installs and builds run from the workspace root, while the package field specifies where the specific site is located. The configuration in
apps/web/netlify.tomlfollows this recommended pattern:
base = "/"ensures pnpm dependencies install from the workspace rootpackage = "apps/web"identifies the site location- All paths (
publish,edge_functions,directory) resolve relative to base correctlycommand = "pnpm -F @hypr/web build"uses the workspace filter syntax to build only the web packageThis is not an inconsistency but the documented best practice for monorepo builds.
Likely an incorrect or invalid review comment.
apps/web/netlify/edge-functions/og.tsx (1)
1-2: JSX import source configuration is correct and verified.React 18.2.0 is available on esm.sh, and using @jsxImportSource pragma is a recommended approach for Deno-based edge functions when an explicit runtime import source is needed. The pragma configuration you've added follows best practices for Netlify Edge Functions. No further changes are required.
feab19f to
7fe18dd
Compare
Adjust Netlify config and OG edge function imports to support running installs/builds from the monorepo root. The netlify.toml now sets base to apps/web and publishes from the package-relative dist/client so builds run correctly when executed from the repository root. Updated edge function file to use deno-lint ignore-file, add React JSX import source and import React to ensure correct JSX handling in Deno/ESM environment.
Remove the unnecessary default React import since the file uses the @jsxImportSource pragma to pull React from esm.sh. This avoids a duplicate import of the same React build and cleans up the edge function code. - Deleted "import React from \"https://esm.sh/react@18.2.0\";" because /** @jsxImportSource https://esm.sh/react@18.2.0 */ already provides the JSX runtime. - Keeps deno.land imports (og_edge, zod) unchanged to use Deno-native modules.
Add a [functions] directory setting to apps/web/netlify.toml pointing to the generated .netlify/v1/functions so Netlify can find the built server functions. The build previously produced apps/web/dist/server/server.js (and .netlify/v1/functions/server.mjs was generated) but Netlify wasn't detecting the functions directory, causing functions to be reported as targeting a non-existing directory. This change ensures Netlify looks for functions in .netlify/v1/functions and preserves the existing edge_functions configuration for /og.
Remove incorrect or redundant build settings in apps/web/netlify.toml to resolve runtime errors caused by misconfigured Netlify function paths. The change cleans up the [build] section by removing a stray base line and eliminates the [functions] directory entry that pointed to a non-existent or incompatible functions path. This aligns the manifest with the actual project layout and helps prevent server errors (like the reported 500 with getRouter undefined) caused by wrong publish/function configuration.
2d27d4e to
34cc55d
Compare
No description provided.