DesignRevision/shards-vue

Does not work in nuxt.js universal mode.

yuta-hayashi opened this issue · 0 comments

Expected Behavior

I used shards-vue in universal mode of nuxt.js. The universal mode executes ssr.

Current Behavior

It did not work at all with the error document is not defined. But, it worked when I changed to spa mode.

Steps to Reproduce

  1. Set nuxt.js to universal mode.
  2. Set shardsVue to nuxt.js plugin.
  3. Use the shardsVue component on the page.

Context (Environment)

I cannot execute SSR or generate in nuxt.js.

Possible Solution

I think it probably contains functions that cannot be executed in SSR.
So when I set the plugin mode in nuxt.config.js to client, it worked fine.

nuxt.config.js

  plugins: [{src:'~/plugins/shardsVue', mode: 'client'}
  ],

I think nuxt.js is one of the most popular frameworks and would you please add this to the documentation if you like?