You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Route ${workStore.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`
46
-
)
47
-
}
48
-
49
-
switch(workUnitStore.type){
50
-
case'cache':
51
-
case'unstable-cache': {
52
-
thrownewError(
53
-
`Route ${workStore.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`
54
-
)
55
-
}
56
-
case'prerender':
57
-
case'prerender-client':
58
-
case'prerender-ppr':
59
-
case'prerender-legacy':
60
-
returncreatePrerenderRootParams(
61
-
workUnitStore.rootParams,
62
-
workStore,
63
-
workUnitStore
64
-
)
65
-
case'private-cache':
66
-
case'prerender-runtime':
67
-
case'request':
68
-
returnPromise.resolve(workUnitStore.rootParams)
69
-
default:
70
-
returnworkUnitStoresatisfiesnever
71
-
}
72
-
}
73
-
74
-
functioncreatePrerenderRootParams(
75
-
underlyingParams: Params,
76
-
workStore: WorkStore,
77
-
prerenderStore: StaticPrerenderStore
78
-
): Promise<Params>{
79
-
switch(prerenderStore.type){
80
-
case'prerender-client': {
81
-
constexportName='`unstable_rootParams`'
82
-
thrownewInvariantError(
83
-
`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`
0 commit comments