mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
We need to disable the default treat `middleware` and `pages/api` as server-only, unless users explictly import "server-only" to poison it. This will avoid the case that when a library is mixing "client-only" API and shared components API in one bundle, and the shared API is used in middleware or `pages/api` that might cause error. See the test case added. Follow up for #55394
6 lines
109 B
JavaScript
6 lines
109 B
JavaScript
import 'server-only'
|
|
|
|
export default function handler(req, res) {
|
|
return res.send('pages/api/hello.js:')
|
|
}
|