next
Version:
The React Framework
21 lines (20 loc) • 1.84 kB
JavaScript
export function createUnrenderedSegmentError(route, missingFiles) {
let message = `Route "${route}": Could not validate that a segment in your UI has instant navigation.`;
if (missingFiles.length > 0) {
const label = missingFiles.length === 1 ? 'Dropped segment' : 'Dropped segments';
message += `\n\nThis segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.` + `\n\n${label}:\n${missingFiles.map((p)=>` ${p}`).join('\n')}` + `\n\nWays to fix this:` + `\n - [render] Render the dropped segment` + `\n - [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation` + `\n\nLearn more: https://nextjs.org/docs/messages/instant-unrendered-segment`;
}
return Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
value: "E1286",
enumerable: false,
configurable: true
});
}
export function createLinkPrefetchPartialError(pathname) {
return Object.defineProperty(new Error(`Next.js encountered dynamic data during prefetching for "${pathname}".\n\n` + `This will lead to slower, more expensive prefetches.\n\n` + `Ways to fix this:\n` + ` - [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in\n` + ` - [disable] Remove \`prefetch={true}\` from the <Link> to use the default prefetch\n` + ` - [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation\n\n` + `Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`), "__NEXT_ERROR_CODE", {
value: "E1435",
enumerable: false,
configurable: true
});
}
//# sourceMappingURL=instant-messages.js.map