Skip to content

Rendering errors during SSR #585

Open
@ulich

Description

@ulich

I am using 3.0.0-beta.28.

If a graphql query is rejected with (e.g. network) errors, i want to render an error message in the component that initiated the query. This works fine on the client side with

  apollo: {
    messages: {
      query: messages,
      error(e) {
        this.error = e
      }
    }
  },
<div v-if="error">Oops. Something went wrong</div>

but when this component is rendered on the server it leads to a rejected serverPrefetch, which in turn stops the rendering of any component that comes after the current component.

What is the general idea on handling errors during server side rendering? When looking at the code, this seems to be implemented on purpose exactly how i experienced it.

My setup is a clean vue-cli 3 project:

vue create ...
vue add apollo
vue add @akryum/ssr

In version 3.0.0-beta.27 it works

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions