Uncaught DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules


vue3+vue-router4在应用过程中,通过composition api watchrouter对象进行监听时,会呈现这个问题。

import { useRoute } from 'vue-router'const route = useRoute()watch(      route,      (to, from) => {        // do something      }    )

解决办法,别监听整个router对象,改为监听其某个属性,如监听path的变动就能够了。

Uncaught (in promise) DOMException: Failed to read the 'value' property from 'SVGLength': Could not resolve relative length.


我的项目中用到了svg,同时做了svg依据主题色进行换色解决的性能(监听了路由的变动去解决),打包部署后呈现这个问题,解决办法如第一个。