Skip to content

Commit

Permalink
fix: rolled back to pusher 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
manchenkoff committed Jul 14, 2024
1 parent da14f65 commit fa42bdf
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 58 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@nuxt/kit": "^3.12.3",
"defu": "^6.1.4",
"laravel-echo": "^1.16.1",
"pusher-js": "8.4.0-rc2"
"pusher-js": "8.3.0"
},
"devDependencies": {
"@nuxt/devtools": "^1.3.9",
Expand Down
135 changes: 81 additions & 54 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/runtime/plugin.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import type { Channel, Options, ChannelAuthorizationCallback } from 'pusher-js'
import type { ChannelAuthorizationData } from 'pusher-js/types/src/core/auth/options'
import { createConsola, type ConsolaInstance } from 'consola'
import type { FetchOptions } from 'ofetch'
import Pusher from 'pusher-js'
import { useEchoConfig } from './composables/useEchoConfig'
import type { Authentication, ModuleOptions } from './types'
import { defineNuxtPlugin, createError, useCookie } from '#app'

declare global {
interface Window {
Echo: Echo
Pusher: typeof Pusher
}
}

Expand Down Expand Up @@ -135,9 +137,7 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
const config = useEchoConfig()
const logger = createEchoLogger(config.logLevel)

const pusher = await import('pusher-js')
// @ts-expect-error Pusher is not defined on Window
window.Pusher = pusher.default || pusher
window.Pusher = Pusher
window.Echo = new Echo(prepareEchoOptions(config, logger))

logger.debug('Laravel Echo client initialized')
Expand Down

0 comments on commit fa42bdf

Please sign in to comment.