Skip to content

fix(cart): force root redirect to products site and add cart link to header - #479

Draft
FrozenPandaz wants to merge 1 commit into
masterfrom
fix/cart-root-redirect-and-header-cart-link
Draft

fix(cart): force root redirect to products site and add cart link to header#479
FrozenPandaz wants to merge 1 commit into
masterfrom
fix/cart-root-redirect-and-header-cart-link

Conversation

@FrozenPandaz

Copy link
Copy Markdown
Contributor

Problem

https://nrwl-nx-examples-cart.netlify.app/ renders a blank page (header only). The / → products site rule in _redirects has been shadowed since it was added (#73): Netlify skips non-forced redirects when a file exists at the requested path, and / matches the published index.html.

There was also no way to navigate from the products site to the cart.

Changes

  • Force the root redirect with 301! in apps/cart/src/_redirects so the cart site root redirects to the products site instead of serving a blank SPA shell
  • Cart link in the shared header: new white cart icon (cart.svg, Material Design glyph) linking to /cart, with aria-label and a unit test. On the products site Netlify already 301s /cart to the cart site
  • Local dev proxies mirroring the Netlify redirects, so cross-app links work when both dev servers run:
    • products (4200) proxies /cart, /static, /rsbuild-hmr → cart (4201)
    • cart (4201) proxies everything it doesn't own → products (4200), like the splat rule
  • serve-with-deps targets on both apps (dependsOn: ["serve", "<other>:serve"]) so one command starts both dev servers

Verification

  • shared-header unit tests pass; both apps build
  • Rendered in headless Chrome: 4200/, 4200/cart, 4201/, 4201/cart, 4201/product/1 all serve the right app with working links

View session information ↗

…header

- Force the / redirect in _redirects with 301! so Netlify doesn't
  shadow it with the published index.html (the cart site root was
  rendering a blank page instead of redirecting)
- Add a cart icon link to the shared header on both apps
- Mirror the Netlify redirects locally with dev-server proxies so
  cross-app links work when serving both apps
- Add serve-with-deps targets to start both dev servers with one command
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for nrwl-nx-examples-dep-graph ready!

Name Link
🔨 Latest commit 9c089a6
🔍 Latest deploy log https://app.netlify.com/projects/nrwl-nx-examples-dep-graph/deploys/6a555747c27e9700081aefe9
😎 Deploy Preview https://deploy-preview-479--nrwl-nx-examples-dep-graph.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.

@nx-cloud

nx-cloud Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 9c089a6

Command Status Duration Result
nx-cloud record -- nx format:check --base=bea3c... ❌ Failed 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-13 21:24:49 UTC

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