rsnext/test/e2e/module-layer
Jiachi Liu 7fe01bb639
Disable client-only for middleware and pages api layer (#55541)
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
2023-09-18 14:59:54 -05:00
..
app Allow server-only in server targets and client-only in client components targets to be available (#55394) 2023-09-18 12:27:45 +00:00
lib/mixed-lib Disable client-only for middleware and pages api layer (#55541) 2023-09-18 14:59:54 -05:00
pages Disable client-only for middleware and pages api layer (#55541) 2023-09-18 14:59:54 -05:00
index.test.ts Disable client-only for middleware and pages api layer (#55541) 2023-09-18 14:59:54 -05:00
middleware.js Disable client-only for middleware and pages api layer (#55541) 2023-09-18 14:59:54 -05:00