Skip to content

Commit

Permalink
fix: added universal import for pusher module
Browse files Browse the repository at this point in the history
  • Loading branch information
manchenkoff committed Jul 24, 2024
1 parent 5079b40 commit 0061f35
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 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.4",
"defu": "^6.1.4",
"laravel-echo": "^1.16.1",
"pusher-js": "^8.3.0"
"pusher-js": "8.4.0-rc2"
},
"devDependencies": {
"@nuxt/devtools": "^1.3.9",
Expand Down
1 change: 0 additions & 1 deletion playground/pusher.d.ts

This file was deleted.

10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

8 changes: 5 additions & 3 deletions src/runtime/plugin.client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Echo from 'laravel-echo'
import Pusher from 'pusher-js/dist/web/pusher'
import type { Channel, Options, ChannelAuthorizationCallback } from 'pusher-js'
import PusherPkg, { type Channel, type Options, type 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 { useEchoConfig } from './composables/useEchoConfig'
import type { Authentication, ModuleOptions } from './types'
import { defineNuxtPlugin, createError, useCookie } from '#app'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Pusher = (PusherPkg as any).default || PusherPkg

declare global {
interface Window {
Echo: Echo
Expand Down Expand Up @@ -133,7 +135,7 @@ function prepareEchoOptions(config: ModuleOptions, logger: ConsolaInstance) {
}
}

export default defineNuxtPlugin(async (_nuxtApp) => {
export default defineNuxtPlugin((_nuxtApp) => {
const config = useEchoConfig()
const logger = createEchoLogger(config.logLevel)

Expand Down
1 change: 0 additions & 1 deletion src/runtime/pusher.d.ts

This file was deleted.

0 comments on commit 0061f35

Please sign in to comment.