Skip to content
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 opened this issue Mar 19, 2019 · 0 comments
Open

Move HEAD assignment for SSR compatibility (assembler) #85

peremp opened this issue Mar 19, 2019 · 0 comments

Comments

@peremp
Copy link
Contributor

peremp commented Mar 19, 2019

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant