私は feathersjs をfeathers-authentication-client
使用しており、移行ガイドを使用するようにアップグレードしたばかりです。feathers-authentication-client
containsの一部socket.io.engine
は未定義であり、エラーをスローします。これは私のコードで、次の場所にsocket.io.engine
表示されauth
ます:
import feathers from 'feathers/client';
import hooks from 'feathers-hooks';
import rest from 'feathers-rest/client';
import socketio from 'feathers-socketio/client';
import auth from 'feathers-authentication-client';
import io from 'socket.io-client';
import superagent from 'superagent';
import config from './config';
const storage = __SERVER__ ? require('localstorage-memory') : window.localStorage;
const host = clientUrl => (__SERVER__ ? `http://${config.apiHost}:${config.apiPort}` : clientUrl);
const configureApp = transport => feathers()
.configure(transport)
.configure(hooks())
.configure(auth({ storage }));
export const socket = io('', { path: host('/ws'), autoConnect: false });
const app = configureApp(socketio(socket));
export default app;
export const restApp = configureApp(rest(host('/api')).superagent(superagent));
私は一度も使用socket.io.engine
したことがなく、この場合の関連性を理解していません。誰かが使用socket.io.engine
して、助ける方法を知っていますか?
スタック トレースを更新する
node_modules/feathers-authentication-client/lib/passport.js:80
[1] socket.io.engine.on('upgrade', function () {
[1] ^
[1]
[1] TypeError: Cannot read property 'on' of undefined
[1] at Passport.setupSocketListeners (node_modules/feathers-authentication-client/lib/passport.js:80:25)
[1] at new Passport (node_modules/feathers-authentication-client/lib/passport.js:44:10)
[1] at Object.<anonymous> (node_modules/feathers-authentication-client/lib/index.js:36:20)
[1] at Object.configure (node_modules/feathers/lib/application.js:138:8)
[1] at configureApp (src/app.js:17:4)
[1] at Object.<anonymous> (src/app.js:21:13)
[1] at Module._compile (module.js:570:32)
[1] at loader (node_modules/babel-register/lib/node.js:144:5)
[1] at Object.require.extensions.(anonymous function) [as .js] (node_modules/babel-register/lib/node.js:154:7)
[1] at Module.load (module.js:487:32)
https://github.com/feathersjs/feathers-authentication-client/blob/master/src/passport.js