Skip to content

Commit

Permalink
fix: skip loading devtools if in SSR closes #4963
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Dec 22, 2024
1 parent db26a74 commit ec121b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/proud-books-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vee-validate": patch
---

fix: skip loading devtools if in SSR
6 changes: 5 additions & 1 deletion packages/vee-validate/src/devtools.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App, ComponentInternalInstance, getCurrentInstance, nextTick, onUnmounted, toValue, unref } from 'vue';
import type { InspectorNodeTag, CustomInspectorState, CustomInspectorNode } from '@vue/devtools-kit';
import { PathState, PrivateFieldContext, PrivateFormContext } from './types';
import { keysOf, setInPath, throttle } from './utils';
import { isClient, keysOf, setInPath, throttle } from './utils';
import { isObject } from '../../shared';

const DEVTOOLS_FORMS: Record<string, PrivateFormContext & { _vm?: ComponentInternalInstance | null }> = {};
Expand Down Expand Up @@ -34,6 +34,10 @@ let API: any;

async function installDevtoolsPlugin(app: App) {
if (__DEV__) {
if (!isClient) {
return;
}

const devtools = await import('@vue/devtools-api');
devtools.setupDevtoolsPlugin(
{
Expand Down

0 comments on commit ec121b1

Please sign in to comment.