next.js
b3f77636 - Fix chunk loading when using `__turbopack_load_by_url__` with query (#88899)

Commit
26 days ago
Fix chunk loading when using `__turbopack_load_by_url__` with query (#88899) - if you `await __turbopack_load_by_url__ `, it waits for the exact chunk url you passed in to load - but when that chunk actually loads, it registers itself with `stripQuery(chunkurl)+CHUNK_SUFFIX` so there was mismatch if you load a chunk from a different deployment and thus `await __turbopack_load_by_url__` never resolves ---- Very confused about what's going on here: ``` FAIL Turbopack test/e2e/app-dir/segment-cache/deployment-skew/deployment-skew.test.ts (61.629 s) segment cache (deployment skew) with BUILD_ID ✓ does not crash when prefetching a dynamic, non-PPR page on a different deployment (11673 ms) ✓ does not crash when prefetching a static page on a different deployment (10744 ms) with NEXT_DEPLOYMENT_ID ✓ does not crash when prefetching a dynamic, non-PPR page on a different deployment (10924 ms) ✕ does not crash when prefetching a static page on a different deployment (15756 ms) ● segment cache (deployment skew) › with NEXT_DEPLOYMENT_ID › does not crash when prefetching a static page on a different deployment page.waitForSelector: Timeout 5000ms exceeded. Call log: - waiting for locator('#build-id') to be visible 519 | 520 | return this.startChain(async () => { > 521 | const el = await page.waitForSelector(selector, { | ^ 522 | timeout, 523 | state, 524 | }) at waitForSelector (lib/browsers/playwright.ts:521:29) at Playwright._chain (lib/browsers/playwright.ts:651:23) at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17) at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17) at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17) at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17) at Object.elementById (e2e/app-dir/segment-cache/deployment-skew/deployment-skew.test.ts:122:37) ``` In the browser debugger, this line here in `fetchServerResponse` never returns, so there is actually no navigation at all (neither SPA nor MPA) when clicking the link, should be doing an MPA nav https://github.com/vercel/next.js/blob/d4e64f52bb9aeb5dbcf6bb484f204742b2e3d743/packages/next/src/client/components/router-reducer/fetch-server-response.ts#L242
Author
Parents
Loading