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
Copy file name to clipboardExpand all lines: packages/next/errors.json
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -715,5 +715,7 @@
715
715
"714": "%s must not be used within a client component. Next.js should be preventing it from being included in client components statically, but did not in this case.",
716
716
"715": "Route %s used %s in Pages Router. This API is only available within App Router.",
717
717
"716": "\\`unstable_rootParams\\` must not be used within a client component. Next.js should be preventing it from being included in client components statically, but did not in this case.",
718
-
"717": "Missing workStore in %s"
718
+
"717": "Missing workStore in %s",
719
+
"718": "Route %s used %s inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.",
720
+
"719": "%s was used inside a Server Action. This is not supported. Functions from 'next/rootparams' can only be called in the context of a route."
"`import('next/root-params').lang()` was used inside a Server Action. This is not supported. Functions from 'next/rootparams' can only be called in the context of a route."
114
+
)
115
+
}
116
+
})
117
+
118
+
// TODO(root-params): add support for route handlers
119
+
it('should error when used in a route handler (until we implement it)',async()=>{
120
+
constparams={lang: 'en',locale: 'us'}
121
+
constresponse=awaitnext.fetch(
122
+
`/${params.lang}/${params.locale}/route-handler`
123
+
)
124
+
expect(response.status).toBe(500)
125
+
if(!isNextDeploy){
126
+
expect(next.cliOutput).toInclude(
127
+
"Route /[lang]/[locale]/route-handler used `import('next/root-params').lang()` inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js."
0 commit comments