VUE專案忽略ResizeObserver loop completed with undelivered notifications錯誤

infocodez發表於2024-03-17

忽略"ResizeObserver loop limit exceeded"和"ResizeObserver loop completed with undelivered notifications."兩種錯誤。
向vue.config.js中新增以下程式碼:

module.exports = defineConfig({
  ...
  devServer: {
    client: {
      overlay: {
        warnings: false,
        runtimeErrors: (error) => {
          const ignoreErrors = [
            "ResizeObserver loop limit exceeded",
            "ResizeObserver loop completed with undelivered notifications.",
          ];
          if (ignoreErrors.includes(error.message)) {
            return false;
          }
        },
      },
    },
  },
});

相關文章