element icon indicating copy to clipboard operation
element copied to clipboard

[Bug Report] Cannot find module 'element-ui/lib/theme-chalk/fonts/element-icons.woff?t=1510834658947'

Open Reechee88 opened this issue 8 years ago • 15 comments

Element UI version

2.0.10

OS/Browsers version

Ubuntu 17.10

Vue version

2.5.13

Reproduction Link

https://jsfiddle.net/mmx38qxw/

Steps to reproduce

I have followed these steps:

http://element.eleme.io/#/en-US/component/custom-theme

I am using nuxt.js 1.0.0-rc11 with webapck 3

What is Expected?

Working custom theme :)

What is actually happening?

Hi,

I am tryin to customize the theme as it written here: http://element.eleme.io/#/en-US/component/custom-theme

Content of my element-variables.scss: ` $--collapse-border-color: #00A6EC; $--collapse-header-color: #00A6EC; $--collapse-header-height: 48px; $--collapse-header-padding: 22px; $--collapse-header-fill: white; $--collapse-header-size: 18px; $--collapse-content-fill: brown; $--collapse-content-size: 20px; $--collapse-content-color: orange;

$--font-path: '~element-ui/lib/theme-chalk/fonts';

@import "~element-ui/packages/theme-chalk/src/index"; `

When webpack compiles the scss, it gives me always this error: Cannot find module 'element-ui/lib/theme-chalk/fonts/element-icons.woff?t=1510834658947'

I have checked and the element-icons.woff exists in the node_modules dir. I can't get rid of this annoying error.

What is the problem? How can I solve it?

Thanks, Richard

Reechee88 avatar Dec 30 '17 11:12 Reechee88

Hey. I'm having this also These relative modules were not found:


* ./fonts/element-icons.ttf?t=1510834658947 in ./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-7ba5bd90","scoped":false,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./src/assets/styles/main.scss
* ./fonts/element-icons.woff?t=1510834658947 in ./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-7ba5bd90","scoped":false,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./src/assets/styles/main.scss

vue version is 2.9.1 element-ui version is 2.0.10

rudirocha avatar Dec 30 '17 21:12 rudirocha

@Reechee88 @rudirocha Please minify your project and upload it to GitHub.

Leopoldthecoder avatar Dec 31 '17 01:12 Leopoldthecoder

had same problem

andreaschrist27 avatar Jan 20 '18 14:01 andreaschrist27

Closing for lack of reproduction.

Leopoldthecoder avatar Jan 21 '18 02:01 Leopoldthecoder

Same problem...

custom theme doc

yoyo837 avatar Jan 23 '18 11:01 yoyo837

If delete the font file query string, it works fine.

e10c6111-42f4-4ad3-8288-9db9eb0fc490 4526a91f-a3d9-4a79-abf3-afebf2163c3e

yoyo837 avatar Jan 23 '18 11:01 yoyo837

Enabling {modules: true} in css-loader is causing the issue.

rumanHuq avatar Jul 19 '18 12:07 rumanHuq

These dependencies were not found:

  • fonts/element-icons.ttf in ./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/lib??ref--6-oneOf-3-2!./node_modules/element-ui/lib/theme-chalk/index.css
  • fonts/element-icons.woff in ./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/lib??ref--6-oneOf-3-2!./node_modules/element-ui/lib/theme-chalk/index.css

Does not occur when css-modules are disabled (as mentioned by rumanbsl).

proepkes avatar Oct 26 '18 08:10 proepkes

Same issue here

alex-shamshurin avatar Nov 05 '18 19:11 alex-shamshurin

vue-cli 3

  • ~element-ui/lib/theme-chalk/fonts/element-icons.ttf in ../node_modules/css-loader??ref--8-oneOf-3-1!./node_modules/postcss-loader/src??ref--8-oneOf-3-2!./node_modules/sass-loader/lib/loader.js??ref--8-oneOf-3-3!./src/assets/scss/element-variables.scss
  • ~element-ui/lib/theme-chalk/fonts/element-icons.woff in ../node_modules/css-loader??ref--8-oneOf-3-1!./node_modules/postcss-loader/src??ref--8-oneOf-3-2!./node_modules/sass-loader/lib/loader.js??ref--8-oneOf-3-3!./src/assets/scss/element-variables.scss

To install them, you can run: npm install --save ~element-ui/lib/theme-chalk/fonts/element-icons.ttf ~element-ui/lib/theme-chalk/fonts/element-icons.woff

Ramarti avatar Jan 03 '19 16:01 Ramarti

I was getting this exact error and was able to resolve it. I missed this important part of the custom theme docs:

Note that it is required to override icon font path to the relative path of Element's font files.

2019-01-08 at 2 02 pm

Adding $--font-path: '~element-ui/lib/theme-chalk/fonts'; before importing the theme's index.scss fixed the error.

skray avatar Jan 08 '19 19:01 skray

Adding $--font-path: '~element-ui/lib/theme-chalk/fonts'; before importing the theme's index.scss fixed the error.

It's working without enabled css modules and give a same error on modules: true

m0rtyn avatar Jan 31 '19 10:01 m0rtyn

This is because wrong path. You should put your style.css in this path:

node_modules/element-ui/lib/theme-chalk

If you look at the style.css content, you will find out why

image

summertian4 avatar May 23 '19 07:05 summertian4

This is because wrong path. You should put your style.css in this path:

node_modules/element-ui/lib/theme-chalk

If you look at the style.css content, you will find out why

image

and then ? what should i do? i saw this before,and how to solve icon import ?????

CracKerMe avatar Jun 22 '20 15:06 CracKerMe

I was getting this exact error and was able to resolve it. I missed this important part of the custom theme docs:

Note that it is required to override icon font path to the relative path of Element's font files.

2019-01-08 at 2 02 pm

Adding $--font-path: '~element-ui/lib/theme-chalk/fonts'; before importing the theme's index.scss fixed the error.

You are my best friend now

toramanlis avatar Nov 18 '20 18:11 toramanlis