nik-zp / Vue-Mqtt

Connect to mqtt through websocket, implementation for Vuejs 2
95 stars 33 forks source link

u is not a constructor - usage in nuxt #10

Open MartinMuzatko opened 5 years ago

MartinMuzatko commented 5 years ago

Hello! I am trying to use vue-mqtt from within nuxt.

image

I tried to create a reproduction sandbox. But after adding the plugin, sandbox freezes: https://codesandbox.io/s/codesandboxnuxt-h6ccq?fontsize=14

This is my plugin usage code:

import Vue from "vue";
import mqtt from "vue-mqtt";

Vue.use(mqtt, "ws://localhost:9001", {});

Is there a way to debug this?

Thanks in advance!

loyalove commented 4 years ago

use nuxt with spa mode use plugin with ssr false