__INTLIFY_PROD_DEVTOOLS__ is not defined

你可能在使用 vuex 4.0.1, 将它降级为 vuex 4.0.0 即可解决。 vuex #1992

如果仍然报错看这个情况。你可能在使用 vite 同时使用 vue-i8n,然后在 vite.config.ts 配置了 alias 解决 vue-i18n 开发环境下的一个警告(vue-i18n.esm-bundler.js:46 You are running the esm-bundler build of vue-i18n.)。

alias: {
  'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
}

仅在生产环境下配置即可解决这个生产环境错误

export default ({ mode }) => {
    const __DEV__ = mode === 'development'

    const alias: Record<string, string> = {
        '@/': `${resolve(__dirname, 'src')}/`,
    }

    if (__DEV__) {
        // 解决警告You are running the esm-bundler build of vue-i18n.
        alias['vue-i18n'] = 'vue-i18n/dist/vue-i18n.cjs.js'
    }

    return defineConfig({
        resolve: {
            alias,
        },
    })
}
posted @ 2021-07-10 15:37  guangzan  阅读(1076)  评论(0)    收藏  举报