@@ -109,6 +109,30 @@ if (!(globalThis as any).isNextDev) {
`You’re importing a class component. It only works in a Client Component`
)
})
// TODO-APP: investigate why the error keeps triggering reloading the page
it.skip('should allow to use and handle rsc poisoning client-only',async()=>{
constbrowser=awaitnext.browser(
'/server-with-errors/client-only-in-server'
)
awaithasRedbox(browser)
consttext=awaitgetRedboxSource(browser)
expect(text).toContain(
`You're importing a component that imports client-only. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.`
)
})
it('should allow to use and handle rsc poisoning server-only',async()=>{
constbrowser=awaitnext.browser(
'/client-with-errors/server-only-in-client'
)
awaithasRedbox(browser)
consttext=awaitgetRedboxSource(browser)
expect(text).toContain(
`You're importing a component that needs server-only. That only works in a Server Component but one of its parents is marked with "use client", so it's a Client Component.`