易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 41|回复: 0
收起左侧

解决vue访问警告:Feature flag __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is not explicitly

[复制链接]
发表于 2025-7-28 10:52:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
main.ts:7 Feature flag__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is not explicitly defined. You arerunning the esm-bundler build of Vue, which expects these compile-time featureflags to be globally injected via the bundler config in order to get bettertree-shaking in the production bundle.
  ^* D: W# i! C( }3 {4 J
解决办法:
需要在vue.config.js文件中添加配置:
const { defineConfig } =require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})
module.exports = {
chainWebpack: (config) => {
   config.plugin('define').tap((definitions) => {
     Object.assign(definitions[0], {
       __VUE_OPTIONS_API__: 'true',
       __VUE_PROD_DEVTOOLS__: 'false',
       __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
      })
     return definitions
   })
  }
}

. _9 o% z+ j& F; d7 R
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:34 , Processed in 0.047748 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表