MCPcopy
hub / github.com/vercel/next.js / beforePageLoad

Function beforePageLoad

test/development/error-overlay/index.test.tsx:23–30  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

21 const feedbackRequests: string[] = []
22 const browser = await next.browser('/known-client-error', {
23 beforePageLoad(page) {
24 page.route(/__nextjs_error_feedback/, (route) => {
25 const url = new URL(route.request().url())
26 feedbackRequests.push(url.pathname + url.search)
27
28 route.fulfill({ status: 204, body: 'No Content' })
29 })
30 },
31 })
32
33 await browser.elementByCss('button').click() // clicked "break on client"

Callers

nothing calls this directly

Calls 4

routeMethod · 0.80
urlMethod · 0.65
pushMethod · 0.65
requestMethod · 0.45

Tested by

no test coverage detected