Static GitHub Issues

[199] web socket usage

prev: Expose webpack config for ESLint
next: version mismatch

How can i use web sockets with nuxt.js. i am porting an application that uses feathers-primus and an aurelia frontend to nuxt.js , using the vue-feathers plugin. i keep getting the below error

ERROR in ./~/primus/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/admin/Documents/Development Stuff/Projects/Ajala2/node_modules/primus'
 @ ./~/primus/index.js 9:9-22
 @ ./plugins/vueFeathers.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js

ERROR in ./~/primus/index.js
Module not found: Error: Can't resolve 'cluster' in '/Users/admin/Documents/Development Stuff/Projects/Ajala2/node_modules/primus'
 @ ./~/primus/index.js 141:51-69
 @ ./plugins/vueFeathers.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js

ERROR in ./~/create-server/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/admin/Documents/Development Stuff/Projects/Ajala2/node_modules/create-server'
 @ ./~/create-server/index.js 6:9-22
 @ ./~/primus/index.js
 @ ./plugins/vueFeathers.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js

ERROR in ./~/forwarded-for/index.js
Module not found: Error: Can't resolve 'net' in '/Users/admin/Documents/Development Stuff/Projects/Ajala2/node_modules/forwarded-for'
 @ ./~/forwarded-for/index.js 3:10-24
 @ ./~/primus/spark.js
 @ ./~/primus/index.js
 @ ./plugins/vueFeathers.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js

ERROR in ./~/config/lib/config.js
Module not found: Error: Can't resolve 'fs' in '/Users/admin/Documents/Development Stuff/Projects/Ajala2/node_modules/config/lib'
 @ ./~/config/lib/config.js 22:17-30
 @ ./~/feathers-configuration/lib/index.js
 @ ./plugins/vueFeathers.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js

ERROR in ./~/config/lib/config.js
Module not found: Error: Can't resolve 'hjson' in '/Users/admin/Documents/Development Stuff/Projects/Ajala2/node_modules/config/lib'
 @ ./~/config/lib/config.js 1017:14-30
 @ ./~/feathers-configuration/lib/index.js
 @ ./plugins/vueFeathers.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js

my plugin configuration file is like this

import Vue from "vue";
import Primus from 'primus';
import VueFeathers from "vue-feathers";
import feathers from "feathers/client";
import rest from 'feathers-rest/client';
import rx from "feathers-reactive";
import RxJS from "rxjs";
import authentication from 'feathers-authentication-client';
import feathersPrimus from "feathers-primus/client";
import request from 'request-promise';

const primus = new Primus(process.env.baseUrl, {
  timeout: 40000
});

feathersClient = feathers()
  // .configure(feathers.authentication({
  //     storage: window.localStorage
  // }))
  .configure(rx(RxJS))
  .configure(feathersPrimus(primus))
  .configure(rest(process.env.baseUrl).request(request));



Vue.use(VueFeathers, feathersClient);
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c167">#c167</a>)</em></sub></div>