element-plus / element-plus-nuxt-starter

🌰 A starter example for element-plus with Nuxt 3.
https://element-plus-nuxt.vercel.app
MIT License
297 stars 82 forks source link

示例demo在执行完yarn install后运行build,generate等会报错,dev不会报错 #58

Closed chencu5958 closed 1 year ago

chencu5958 commented 1 year ago

如上述标题所述,我在github codespace下执行yarn install安装好依赖后,执行build,generate等都会出现例如这样的报错 ,使用dev就正常,排查后怀疑是nuxt3.1.x和elementplus有兼容性问题,将nuxt版本锁定在3.0.0则正常无报错,在锁定版本测试时仅将package.json里有关nuxt的依赖版本从"^3.0.0"修改为了"~3.0.0"或"3.0.0",别的均未修改

ℹ Initializing prerenderer

ERROR Error: Could not load raw:element-plus/theme-chalk/el-icon.css (imported by node_modules/element-plus/es/components/icon/style/css.mjs): ENOENT: no such file or directory, open 'element-plus/theme-chalk/el-icon.css'

undefined

ERROR Could not load raw:element-plus/theme-chalk/el-icon.css (imported by node_modules/element-plus/es/components/icon/style/css.mjs): ENOENT: no such file or directory, open 'element-plus/theme-chalk/el-icon.css'

chencu5958 commented 1 year ago

发现这个问题的原因也是因为我在另外一个使用Nuxt3+Element Plus的项目里也遇到了相同的情况,只能是锁定了Nuxt3的版本号,要不然到了Initializing prerenderer这步就指定会报错

TarasoffSergey commented 1 year ago

I have the same problem :-( Will follow this issue

tolking commented 1 year ago

Link

This issue has been fixed and we will release a new version for @element-plus/nuxt in the near future.

tolking commented 1 year ago

A new version for @element-plus/nuxt has been release, Please update to the latest version (1.0.3).

chencu5958 commented 1 year ago

A new version for @element-plus/nuxt has been release, Please update to the latest version (1.0.3).

可以正常用了,感谢