Skip to content

Fix repo issues: deploy link, SPA routing, and console logs#23

Draft
Hrithik-05-Roshan wants to merge 1 commit into
mainfrom
fix-github-issues-17973872772833499629
Draft

Fix repo issues: deploy link, SPA routing, and console logs#23
Hrithik-05-Roshan wants to merge 1 commit into
mainfrom
fix-github-issues-17973872772833499629

Conversation

@Hrithik-05-Roshan
Copy link
Copy Markdown
Owner

This pull request resolves a series of related bugs involving URL generation, SPA routing fallbacks, navigation state, and logging readability.

Fixes implemented:

  1. Issue 1 - Deployment URL resolution: The backend deploy function now falls back to "https://webify-ai-1.onrender.com" when process.env.FRONTEND_URL is undefined, preventing links from resolving to undefined/site/:slug leading to 404s.
  2. Issue 2 - SPA Routing via Render Config: Created render.yaml at the project root defining rewrite rules (/* -> /index.html) to correctly handle React Router navigation fallback when pages are directly loaded or refreshed.
  3. Issue 3 - Pricing Success Redirects: Swapped out a non-SPA compliant window.location.href = "/dashboard" for the react-router-dom standard navigate("/dashboard") after payment completion, preventing full page reloads that triggred 404 routing errors.
  4. General Cleanup: Refactored frontend error handling by swapping console.log(error) for console.error and cleaned up residual debug messages on successful API posts.

PR created automatically by Jules for task 17973872772833499629 started by @Hrithik-05-Roshan

- Added a fallback for `process.env.FRONTEND_URL` in the server's deploy controller to ensure generated deploy URLs are valid when environment variables are missing (Fixes Issue 1).
- Created a `render.yaml` configuration at the repository root to enable SPA rewrite routing (`/*` to `/index.html`) for the React frontend on Render.com deployments (Fixes Issue 2).
- Replaced direct `window.location.href` navigation with `navigate` via `useNavigate` hook in `Pricing.jsx` to prevent SPA routing 404s after successful Razorpay payments (Fixes Issue 3).
- Cleaned up console logging across the frontend codebase by removing debugging `console.log(result)` lines and updating `console.log(error)` inside catch blocks to `console.error`.

Co-authored-by: Hrithik-05-Roshan <182404308+Hrithik-05-Roshan@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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