#19
next-best-practices: proxy.ts matcher example exports proxyConfig, which Next does not read
What is wrong
next-best-practices/file-conventions.md documents the v16 proxy file convention as:
| version | file | function | config export |
|---|---|---|---|
| v16+ | proxy.ts | proxy() | proxyConfig |
Next reads the matcher from export const config. proxyConfig is not a recognised export, so a matcher written from this row never applies and the proxy runs on every request.
How to check it
Against the documentation that ships with the package, for the exact installed version:
$ cat node_modules/next/package.json | jq -r .version
16.3.4
$ rg -l proxyConfig node_modules/next/dist/docs/
# no files
$ rg -n -A3 'export const config' node_modules/next/dist/docs/01-app/03-api-reference/03-file-conventions/proxy.md
36:export const config = {
37: matcher: '/about/:path*',
38:}Two more in the same skill
bundling.md— the "Good: use dynamic import withssr: false" example has no'use client', soPageis a Server Component, where Next rejectsnext/dynamic(..., { ssr: false })at build time.data-patterns.md— "Server Component fetch | Internal reads | Any | Full Next.js caching" describes pre-15 behaviour;fetchis not cached by default in 15+.
Related
The same files ship inside the Vercel plugin's nextjs skill, filed as vercel/vercel-plugin#199.
Activity
0No activity yet.