From 7a20d84f6a6562a0cd969b4076ff13647b72b458 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 15 May 2026 17:34:09 +0000
Subject: [PATCH 1/4] Fix transient provider gap causing useDemoBalance crash
on welcome
Agent-Logs-Url: https://github.com/WeWriteApp/WeWrite/sessions/8127f7df-0752-4275-b627-c4623eff2a66
Co-authored-by: sirjamesgray <16139439+sirjamesgray@users.noreply.github.com>
---
app/providers/ConsolidatedProviders.tsx | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/app/providers/ConsolidatedProviders.tsx b/app/providers/ConsolidatedProviders.tsx
index 57c8ffbc..8982864f 100644
--- a/app/providers/ConsolidatedProviders.tsx
+++ b/app/providers/ConsolidatedProviders.tsx
@@ -103,9 +103,23 @@ export function NavigationProviders({ children }: { children: React.ReactNode })
*/
export function AllAppProviders({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
- const isRootOrAuthFlow = !pathname || pathname === '/' || pathname.startsWith('/auth');
+ const isRootOrAuthFlow = pathname === '/' || pathname?.startsWith('/auth');
const isWelcomeFlow = pathname?.startsWith('/welcome');
+ // During transitional renders where pathname is temporarily unavailable,
+ // use the full provider stack to avoid missing required contexts.
+ if (!pathname) {
+ return (
+
+
+
+ {children}
+
+
+
+ );
+ }
+
if (isRootOrAuthFlow) {
return (
From 788dfff6f40def42f044b415d003bd998be88a77 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 15 May 2026 17:34:37 +0000
Subject: [PATCH 2/4] Refine pathname checks in provider routing logic
Agent-Logs-Url: https://github.com/WeWriteApp/WeWrite/sessions/8127f7df-0752-4275-b627-c4623eff2a66
Co-authored-by: sirjamesgray <16139439+sirjamesgray@users.noreply.github.com>
---
app/providers/ConsolidatedProviders.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/providers/ConsolidatedProviders.tsx b/app/providers/ConsolidatedProviders.tsx
index 8982864f..10439152 100644
--- a/app/providers/ConsolidatedProviders.tsx
+++ b/app/providers/ConsolidatedProviders.tsx
@@ -103,8 +103,6 @@ export function NavigationProviders({ children }: { children: React.ReactNode })
*/
export function AllAppProviders({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
- const isRootOrAuthFlow = pathname === '/' || pathname?.startsWith('/auth');
- const isWelcomeFlow = pathname?.startsWith('/welcome');
// During transitional renders where pathname is temporarily unavailable,
// use the full provider stack to avoid missing required contexts.
@@ -120,6 +118,9 @@ export function AllAppProviders({ children }: { children: React.ReactNode }) {
);
}
+ const isRootOrAuthFlow = pathname === '/' || pathname.startsWith('/auth');
+ const isWelcomeFlow = pathname.startsWith('/welcome');
+
if (isRootOrAuthFlow) {
return (
From 89d72c97777dcfc76a3078129da75a8854c5fbe1 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 16 May 2026 14:20:53 +0000
Subject: [PATCH 3/4] Fix Vercel serverless tracing to avoid Bun symlink paths
Agent-Logs-Url: https://github.com/WeWriteApp/WeWrite/sessions/ca86ddfd-60dd-4bd4-8984-fb27edd7ee19
Co-authored-by: sirjamesgray <16139439+sirjamesgray@users.noreply.github.com>
---
next.config.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/next.config.js b/next.config.js
index fe6683c6..0575b1eb 100644
--- a/next.config.js
+++ b/next.config.js
@@ -152,11 +152,15 @@ const nextConfig = {
'jose',
],
- // Explicitly include jose in serverless function traces
- // This fixes the "Cannot find package 'jose'" error on Vercel when using bun lockfile
- // bun creates a .bun folder symlink structure that Vercel's runtime can't resolve
+ // Explicitly include jose + jwks-rsa in serverless function traces.
+ // IMPORTANT: Bun installs `node_modules/` as symlinks into `node_modules/.bun/...`.
+ // Including symlinked paths can produce invalid Vercel Serverless deployment packages.
+ // We therefore trace the real Bun store paths directly and avoid symlink globs.
outputFileTracingIncludes: {
- '/api/**/*': ['./node_modules/jose/**/*', './node_modules/jwks-rsa/**/*'],
+ '/api/**/*': [
+ './node_modules/.bun/jose@*/node_modules/jose/**/*',
+ './node_modules/.bun/jwks-rsa@*/node_modules/jwks-rsa/**/*',
+ ],
},
// Logging configuration
From b8a51378d869068d1f091931db79942aeaa1ab40 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 16 May 2026 14:27:39 +0000
Subject: [PATCH 4/4] Fix provider gating for landing and allow LogRocket
connect host in CSP
Agent-Logs-Url: https://github.com/WeWriteApp/WeWrite/sessions/91a6e09b-bd6f-48f0-92e6-c3e2946a5d9a
Co-authored-by: sirjamesgray <16139439+sirjamesgray@users.noreply.github.com>
---
app/providers/ConsolidatedProviders.tsx | 4 ++--
next.config.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/providers/ConsolidatedProviders.tsx b/app/providers/ConsolidatedProviders.tsx
index 10439152..ea8a7d55 100644
--- a/app/providers/ConsolidatedProviders.tsx
+++ b/app/providers/ConsolidatedProviders.tsx
@@ -118,10 +118,10 @@ export function AllAppProviders({ children }: { children: React.ReactNode }) {
);
}
- const isRootOrAuthFlow = pathname === '/' || pathname.startsWith('/auth');
+ const isAuthFlow = pathname.startsWith('/auth');
const isWelcomeFlow = pathname.startsWith('/welcome');
- if (isRootOrAuthFlow) {
+ if (isAuthFlow) {
return (
{children}
diff --git a/next.config.js b/next.config.js
index 0575b1eb..553b6da6 100644
--- a/next.config.js
+++ b/next.config.js
@@ -243,7 +243,7 @@ const nextConfig = {
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://connect-js.stripe.com https://*.stripe.com",
"font-src 'self' https://fonts.gstatic.com",
"img-src 'self' data: https: https://*.stripe.com https://*.tile.openstreetmap.org https://*.basemaps.cartocdn.com https://cdnjs.cloudflare.com",
- "connect-src 'self' https://api.stripe.com https://connect-js.stripe.com https://*.stripe.com wss://*.stripe.com https://*.googleapis.com https://apis.google.com https://firebase.googleapis.com https://firestore.googleapis.com https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel https://firebaseinstallations.googleapis.com https://securetoken.googleapis.com https://identitytoolkit.googleapis.com wss://*.firebaseio.com https://*.firebaseio.com https://www.googletagmanager.com https://www.google-analytics.com https://analytics.google.com https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://cdn.lgrckt-in.com https://*.lgrckt-in.com https://va.vercel-scripts.com https://*.vercel-scripts.com wss://api.wewrite.app https://api.wewrite.app https://cdn.lordicon.com https://challenges.cloudflare.com",
+ "connect-src 'self' https://api.stripe.com https://connect-js.stripe.com https://*.stripe.com wss://*.stripe.com https://*.googleapis.com https://apis.google.com https://firebase.googleapis.com https://firestore.googleapis.com https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel https://firebaseinstallations.googleapis.com https://securetoken.googleapis.com https://identitytoolkit.googleapis.com wss://*.firebaseio.com https://*.firebaseio.com https://www.googletagmanager.com https://www.google-analytics.com https://analytics.google.com https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://cdn.lgrckt-in.com https://*.lgrckt-in.com https://*.logr-in.com https://va.vercel-scripts.com https://*.vercel-scripts.com wss://api.wewrite.app https://api.wewrite.app https://cdn.lordicon.com https://challenges.cloudflare.com",
"report-uri /api/csp-violations",
"frame-src 'self' https://js.stripe.com https://connect-js.stripe.com https://*.stripe.com https://*.firebaseapp.com https://wewrite-ccd82.firebaseapp.com https://challenges.cloudflare.com",
"worker-src 'self' blob:",