amineyarman/vue-kinesis

Nuxt JS navigator.userAgent Error - SSR

Closed this issue ยท 4 comments

Hi, I get the following error when working with NuxtJS due to navigator not being available server-side with SSR.

If I directly edit the vue-kinesis.umd.js file in node_modules to remove this user agent check then it works okay (guessing this has an impact on mobile?)

Any help or suggestions would be great, thank you.

Screenshot 2020-05-17 at 23 26 09

Did you try importing the plugin with mode: 'client' enabled, like this? plugins: [{ src: '~/plugins/vue-kinesis.js', mode: 'client' }]

Wouldn't this would have negative effect on SEO? I have content inside kinesis elements that are crucial.

You are confusing client-only with mode: client, the former only showing content in browser whereas mode: client won't run the code in question but will keep your HTML structure intact (if the content is not injected by JS which is not the case here). Your HTML structure is and should be your main source for SEO. So no - it wouldn't.

Hello!
A fix have been published through this PR: #41
Also I have updated the dist files with further SSR optimizations.
Please let me know if you still have any issues.