Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Move HEAD assignment for SSR compatibility (assembler) #85

Open
@peremp

Description

@peremp

When you import an SFC on Nuxt, it throws the following error even if the Component is SSR ready:
Reason: ReferenceError: document is not defined

This error is fixed by moving this

const head = document.head || document.getElementsByTagName('head')[0]

inside the addStyle function

return function addStyle(id, css) {

I cannot see any drawback of doing that, but you know better than me so, could that be done?

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