Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全量引入报错 #425

Closed
xlzy520 opened this issue Nov 17, 2022 · 4 comments · Fixed by #426
Closed

全量引入报错 #425

xlzy520 opened this issue Nov 17, 2022 · 4 comments · Fixed by #426
Labels
bug Something isn't working welcome PR Welcome Pull requests

Comments

@xlzy520
Copy link

xlzy520 commented Nov 17, 2022

依赖版本

"element-plus": "^2.2.18",
"element-pro-components": "^1.2.6",
"vite": "2.8.6",
(this will be run only when your dependencies or config have changed)
✘ [ERROR] Could not resolve "element-plus/es/components/setps/style/css"

    node_modules/element-pro-components/lib/styles/form.js:8:7:
      8 │ import 'element-plus/es/components/setps/style/css'
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The module "./es/components/setps/style/css.mjs" was not found on the file system:

    node_modules/element-plus/package.json:30:14:
      30 │     "./es/*": "./es/*.mjs",
         ╵               ~~~~~~~~~~~~

  You can mark the path "element-plus/es/components/setps/style/css" as external to exclude it from
  the bundle, which will remove this error.

✘ [ERROR] Could not resolve "element-plus/es/components/setp/style/css"

    node_modules/element-pro-components/lib/styles/form.js:9:7:
      9 │ import 'element-plus/es/components/setp/style/css'
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The module "./es/components/setp/style/css.mjs" was not found on the file system:

    node_modules/element-plus/package.json:30:14:
      30 │     "./es/*": "./es/*.mjs",
         ╵               ~~~~~~~~~~~~

  You can mark the path "element-plus/es/components/setp/style/css" as external to exclude it from
  the bundle, which will remove this error.

error when starting dev server:
Error: Build failed with 2 errors:
node_modules/element-pro-components/lib/styles/form.js:8:7: ERROR: Could not resolve "element-plus/es/components/setps/style/css"
node_modules/element-pro-components/lib/styles/form.js:9:7: ERROR: Could not resolve "element-plus/es/components/setp/style/css"

@xlzy520
Copy link
Author

xlzy520 commented Nov 17, 2022

单独使用Element Plus正常

@xlzy520
Copy link
Author

xlzy520 commented Nov 17, 2022

import ElementPro from 'element-pro-components'
// import 'element-pro-components/lib/styles/index'

这样注释掉style引入也正常

@tolking
Copy link
Owner

tolking commented Nov 18, 2022

似乎是 steps 拼写错误引起的

现在你可以直接引用 css 文件,(这样不包括来自 ElementPlus 的样式)

- import 'element-pro-components/lib/styles/index'
+ import 'element-pro-components/lib/styles/index.css'

@tolking tolking added bug Something isn't working welcome PR Welcome Pull requests labels Nov 18, 2022
@xlzy520
Copy link
Author

xlzy520 commented Nov 20, 2022

感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working welcome PR Welcome Pull requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants