Skip to content

Commit 0061f35

Browse files
committed
fix: added universal import for pusher module
1 parent 5079b40 commit 0061f35

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@nuxt/kit": "^3.12.4",
4343
"defu": "^6.1.4",
4444
"laravel-echo": "^1.16.1",
45-
"pusher-js": "^8.3.0"
45+
"pusher-js": "8.4.0-rc2"
4646
},
4747
"devDependencies": {
4848
"@nuxt/devtools": "^1.3.9",

playground/pusher.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runtime/plugin.client.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import Echo from 'laravel-echo'
2-
import Pusher from 'pusher-js/dist/web/pusher'
3-
import type { Channel, Options, ChannelAuthorizationCallback } from 'pusher-js'
2+
import PusherPkg, { type Channel, type Options, type ChannelAuthorizationCallback } from 'pusher-js'
43
import type { ChannelAuthorizationData } from 'pusher-js/types/src/core/auth/options'
54
import { createConsola, type ConsolaInstance } from 'consola'
65
import type { FetchOptions } from 'ofetch'
76
import { useEchoConfig } from './composables/useEchoConfig'
87
import type { Authentication, ModuleOptions } from './types'
98
import { defineNuxtPlugin, createError, useCookie } from '#app'
109

10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
const Pusher = (PusherPkg as any).default || PusherPkg
12+
1113
declare global {
1214
interface Window {
1315
Echo: Echo
@@ -133,7 +135,7 @@ function prepareEchoOptions(config: ModuleOptions, logger: ConsolaInstance) {
133135
}
134136
}
135137

136-
export default defineNuxtPlugin(async (_nuxtApp) => {
138+
export default defineNuxtPlugin((_nuxtApp) => {
137139
const config = useEchoConfig()
138140
const logger = createEchoLogger(config.logLevel)
139141

src/runtime/pusher.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)