Skip to content

SSR rendering with plugins that modifies prototype #392

@alx13

Description

@alx13

I'm having problem with SSR rendering of my project, which is using Vuetify:

  1. Some of the components rely on existance of $vuetify property in the instance of Vue inherited from Vue.prototype (e.g., VToolbar).
    Obviously, createFakeInstance doesn't merge $vuetify from Vue.prototype into fake instance, causing rendering error in prefetchAll.
    Unfortunatelly there is no way to supress printing that error to the console.

  2. Some components are using provide property of Vue component like in Themeable.
    createFakeInstance also ignores provide/inject definitions on component. So there is another rendering error.

The quick but very dirty solution for problems mentioned above is to allow to configure COMPONENT_BLACKLIST, for example, using options for install method of vue-apollo/ssr plugin, or by providing options to the prefetchAll method.

The less hacky solution for the first problem is to provide a list of Vue.prototype properties that should be inherited from Globals.Vue upon fakeInstance creation. Either with Vue.use(ApolloSSR, { inheritedProperties: ['$vuetify'] }), or in prefetchAll method.

For the second problem, I wasn't able to fix it in any way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions