nuxtseo-layer-devtools 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import type { NuxtDevtoolsClient } from '@nuxt/devtools-kit/types'
2
2
  import type { $Fetch } from 'nitropack/types'
3
3
  import type { Ref } from 'vue'
4
- import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client'
4
+ import { onDevtoolsClientConnected, useDevtoolsClient } from '@nuxt/devtools-kit/iframe-client'
5
5
  import { ofetch } from 'ofetch'
6
6
  import { ref, watch, watchEffect } from 'vue'
7
7
  import { isConnected, refreshSources, standaloneUrl } from './state'
@@ -24,6 +24,12 @@ export interface DevtoolsConnectionOptions {
24
24
  * - **Standalone**: running directly in a browser tab with a manual dev server URL
25
25
  */
26
26
  export function useDevtoolsConnection(options: DevtoolsConnectionOptions = {}): void {
27
+ // Workaround: devtools-kit@4.0.0-alpha.3 bug where onDevtoolsClientConnected
28
+ // defines a window.__NUXT_DEVTOOLS__ getter that reads clientRef.value, but
29
+ // clientRef is only initialized by useDevtoolsClient(). Call it first to avoid
30
+ // "Cannot read properties of undefined (reading 'value')" on the getter.
31
+ useDevtoolsClient()
32
+
27
33
  // Embedded mode: connect via devtools-kit iframe client
28
34
  onDevtoolsClientConnected(async (client) => {
29
35
  isConnected.value = true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxtseo-layer-devtools",
3
3
  "type": "module",
4
- "version": "0.3.7",
4
+ "version": "0.3.8",
5
5
  "description": "Shared Nuxt layer for Nuxt SEO devtools clients.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",