ReferenceError: Pusher is not defined

46 Views Asked by At

enter image description here Websocket can run well but there is still an error, namely Reference Pusher is not defined, what should I do.

export const echoInstance = new Echo({
  broadcaster: "pusher",
  key: process.env.PUSHER_APP_KEY,
  wsHost: process.env.PUSHER_HOST,
  wsPort:  process.env.PUSHER_PORT,
  forceTLS: true,
  disableStats: true,
  encrypted: true,
  cluster:  process.env.PUSHER_APP_CLUSTER,
  authEndpoint:  process.env.PUSHER_AUTH_ENDPOINT,
  auth: {
    headers: {
      Accept: "application/json",
      Authorization:
      `Bearer ${existingToken}`,
    },
  },
  enabledTransports: ['ws', 'wss'],
});
0

There are 0 best solutions below