it('should catch invalid element from a browser only component',async()=>{
constbrowser=awaitnext.browser('/browser')
awaitassertHasRedbox(browser)
constsource=awaitgetRedboxSource(browser)
awaitexpect(browser).toDisplayRedbox(`
{
"count": 1,
"description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
"description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
3 | // Intermediate component for testing owner stack
4 | function Inner() {
Check the render method of \`Inner\`.",
"environmentLabel": null,
"label": "Unhandled Runtime Error",
"source": "app/rsc/page.js (5:10) @ Inner
> 5 | return <Foo />
| ^
6 | }
7 |
8 | export default function Page() {"
| ^",
"stack": [
"Inner app/rsc/page.js (5:10)",
"Page app/rsc/page.js (11:7)",
],
}
`)
})
it('should catch invalid element from on ssr client component',async()=>{
"description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
5 | // Intermediate component for testing owner stack