Skip to content

Commit 294c599

Browse files
committed
[test] Debug searchparams-reuse-loading on Vercel
1 parent b7bce69 commit 294c599

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
console.log(
2+
new Error("This is a custom error message", { cause: { foo: 1, bar: 1 } })
3+
);

test/e2e/app-dir/searchparams-reuse-loading/searchparams-reuse-loading.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe('searchparams-reuse-loading', () => {
175175
it('should correctly return different RSC data for full prefetches with different searchParam values', async () => {
176176
const rscRequestPromise = new Map<
177177
string,
178-
{ resolve: () => Promise<void> }
178+
{ resolve: () => Promise<void>; headers: Record<string, string> }
179179
>()
180180

181181
// Track prefetch requests to know when initial prefetching is done
@@ -235,7 +235,14 @@ describe('searchparams-reuse-loading', () => {
235235
})
236236

237237
if (rscRequestPromise.has(promiseKey)) {
238-
throw new Error('Duplicate request')
238+
const previousHeaders =
239+
rscRequestPromise.get(promiseKey)!.headers
240+
throw new Error(
241+
'' +
242+
`Duplicate request for '${promiseKey}'\n` +
243+
`previous headers: ${JSON.stringify(previousHeaders)}\n` +
244+
`new headers: ${JSON.stringify(headers)} `
245+
)
239246
}
240247

241248
rscRequestPromise.set(promiseKey, {
@@ -245,6 +252,7 @@ describe('searchparams-reuse-loading', () => {
245252
await new Promise((res) => setTimeout(res, 500))
246253
resolvePromise()
247254
},
255+
headers,
248256
})
249257

250258
// Await the promise to effectively stall the request

0 commit comments

Comments
 (0)