Element-Plus:No known conditions for “./lib/locale/lang/zh-cn“

一、问题描述:

在Element-Plus升级时可能会遇到:

[vite] Internal server error: No known conditions for “./lib/locale/lang/zh-cn” specifier in “element-plus” package

二、解决方案

将以下代码:

import localeZH from 'element-plus/lib/locale/lang/zh-cn'

替换为:

import localeZH from 'element-plus/es/locale/lang/zh-cn'

你可能感兴趣的:(开发问题,#,ElementUI开发问题,前端)