Skip to content

Bug: Testing Components that use (async) Server Component Fails #33

@Marty-Byrde

Description

@Marty-Byrde

When any component or page that is a client or server component uses another server-component within itself, any test-case that tests this component will fail due to this error:

Error: Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead.

Wrapping the server component within a Suspense tag does not resolve this issue either, e.g.:

function AnyComponent() {

return (<div>
   ...
   <Suspense fallback={<div> Loading... </div>}>
      <AnyServerComponent/>
   </Suspense>
</div>)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions