import element-plus css.
See original GitHub issueSSG building produce an issue, when use button of element-plus. CSS importing has some problem.
[vite-ssg] Build for server...
vite v2.7.6 building SSR bundle for production...
✓ 52 modules transformed.
.vite-ssg-temp/manifest.webmanifest 0.38 KiB
.vite-ssg-temp/main.mjs 61.38 KiB
.vite-ssg-temp/assets/style.52c8292a.css 21.69 KiB
[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/rzp/Code/github/vitesee/node_modules/element-plus/es/components/button/style/css' imported from /Users/rzp/Code/github/vitesee/.vite-ssg-temp/main.mjs
at new NodeError (node:internal/errors:371:5)
at finalizeResolution (node:internal/modules/esm/resolve:391:11)
at moduleResolve (node:internal/modules/esm/resolve:893:10)
at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:1004:11)
at Loader.resolve (node:internal/modules/esm/loader:89:40)
at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11
Top Results From Across the Web
Quick Start | Element Plus
Manually import Element Plus provides out of box Tree Shaking functionalities based on ES Module. But you need install unplugin-element-plus for style import. ......
Read more >How to add element-ui (now called element-plus) to Vue3 ...
If you are using vue 3 you need to import createApp as well as css from 'element-plus/...' folder. Then you instance your app...
Read more >unplugin-element-plus - npm
Features · On-demand import style for Element Plus. · Replace default locale. · ⚡️ Supports Vite, Webpack, Vue CLI, Rollup, esbuild and ...
Read more >Element Plus Playground
import { version as EpVersion } from 'element-plus'. 4. import { ElementPlus } from '@element-plus/icons-vue'. 5. . 6. const msg = ref('Hello World!')....
Read more >How to Install Element Plus on Laravel Jetstream - Medium
Third, on the app.js file in your project, import ElementPlus including the css file, and don't forget to add the .use(ElementPlus) at the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I add the ssr options in
vite.config.js
, it works for me.try this in vite.config
Components({ ... resolvers: [ ElementPlusResolver({ importStyle: 'css', ssr: true }), ... ] })