diff --git a/shell/plugins/dashboard-store/mutations.js b/shell/plugins/dashboard-store/mutations.js index f440f747d01..de9c49836eb 100644 --- a/shell/plugins/dashboard-store/mutations.js +++ b/shell/plugins/dashboard-store/mutations.js @@ -1,4 +1,4 @@ -import Vue from 'vue'; +import Vue, { markRaw } from 'vue'; import { addObject, addObjects, clear, removeObject } from '@shell/utils/array'; import { SCHEMA, COUNT } from '@shell/config/types'; import { normalizeType, keyFieldFor } from '@shell/plugins/dashboard-store/normalize'; @@ -34,10 +34,10 @@ function registerType(state, type) { * Used to cancel incremental loads if the page changes during load */ loadCounter: 0, - }; - // Not enumerable so they don't get sent back to the client for SSR - Object.defineProperty(cache, 'map', { value: new Map() }); + // Not enumerable so they don't get sent back to the client for SSR + map: markRaw(new Map()), + }; Vue.set(state.types, type, cache); } diff --git a/shell/store/index.js b/shell/store/index.js index fd507b42dcb..4157d514f60 100644 --- a/shell/store/index.js +++ b/shell/store/index.js @@ -37,6 +37,7 @@ import { addParam } from '@shell/utils/url'; import semver from 'semver'; import { STORE, BLANK_CLUSTER } from '@shell/store/store-types'; import { isDevBuild } from '@shell/utils/version'; +import { markRaw } from 'vue'; // Disables strict mode for all store instances to prevent warning about changing state outside of mutations // because it's more efficient to do that sometimes. @@ -247,9 +248,9 @@ export const state = () => { isRancherInHarvester: false, targetRoute: null, rootProduct: undefined, - $router: undefined, - $route: undefined, - $plugin: undefined, + $router: markRaw(undefined), + $route: markRaw(undefined), + $plugin: markRaw(undefined), }; }; @@ -728,15 +729,15 @@ export const mutations = { }, setRouter(state, router) { - state.$router = router; + state.$router = markRaw(router); }, setRoute(state, route) { - state.$route = route; + state.$route = markRaw(route); }, setPlugin(state, pluginDefinition) { - state.$plugin = pluginDefinition; + state.$plugin = markRaw(pluginDefinition); } };