question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to use element-ui in this template?

See original GitHub issue

Describe the bug

how to use element-ui in this template?

element-ui: https://element.eleme.io/#/en-US/component/quickstart

To Reproduce Steps to reproduce the behavior:

  1. use vue init kocal/vue-web-extension tmp to install a tmp project and install and so on.
  2. follow element-ui guide using npm i element-ui -S
  3. usually I add this in main.js of vue-cli template, image

in this project, I tried to add it in popup.js like this.

import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import router from './router'

Vue.use(ElementUI);

/* eslint-disable no-new */
new Vue({
  el: '#app',
  
  router,
  render: h => h(App)
})

finally, I got those errors in my terminal,

ERROR in ../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/index.css
Module build failed (from ../node_modules/_mini-css-extract-plugin@0.4.5@mini-css-extract-plugin/dist/loader.js):
ModuleParseError: Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
    at handleParseError (/Users/goddy/code-repo/tmp/node_modules/_webpack@4.35.2@webpack/lib/NormalModule.js:450:19)
    at doBuild.err (/Users/goddy/code-repo/tmp/node_modules/_webpack@4.35.2@webpack/lib/NormalModule.js:484:5)
    at runLoaders (/Users/goddy/code-repo/tmp/node_modules/_webpack@4.35.2@webpack/lib/NormalModule.js:343:12)
    at /Users/goddy/code-repo/tmp/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/goddy/code-repo/tmp/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:214:10)
    at /Users/goddy/code-repo/tmp/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:205:4
    at process.nextTick (/Users/goddy/code-repo/tmp/node_modules/_enhanced-resolve@4.1.0@enhanced-resolve/lib/CachedInputFileSystem.js:73:15)
    at process._tickCallback (internal/process/next_tick.js:150:11)
 @ ./popup/popup.js 4:0-46
Child mini-css-extract-plugin ../node_modules/_css-loader@2.1.1@css-loader/dist/cjs.js!../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/index.css:
    Entrypoint mini-css-extract-plugin = *
    
    ERROR in ../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/fonts/element-icons.ttf 1:0
    Module parse failed: Unexpected character '' (1:0)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    (Source code omitted for this binary file)
     @ ../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/index.css (../node_modules/_css-loader@2.1.1@css-loader/dist/cjs.js!../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/index.css) 5:41-77
    
    ERROR in ../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/fonts/element-icons.woff 1:4
    Module parse failed: Unexpected character '' (1:4)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    (Source code omitted for this binary file)
     @ ../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/index.css (../node_modules/_css-loader@2.1.1@css-loader/dist/cjs.js!../node_modules/_element-ui@2.10.0@element-ui/lib/theme-chalk/index.css) 4:41-78

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Goddywucommented, Jul 4, 2019

thanks, you are a very good guy.

❀.(´▽`)❀.

0reactions
Kocalcommented, Jul 4, 2019

Ah, that’s because there is no loader for fonts, it fails when trying to resolve .ttf and .woff files.

You can find the patch here, I will also open a PR to handle fonts directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

element-ui examples - CodeSandbox
Learn how to use element-ui by viewing and forking element-ui example apps on CodeSandbox.
Read more >
Introduction | vue-element-admin
vue-element-admin is a production-ready front-end solution for admin interfaces. It based on vue and use the UI Toolkit element-ui .
Read more >
Element - A Desktop UI Toolkit for Web
Use encapsulated code to improve developing efficiency. View Detail. Theme. Online theme roller, visualize custom and manage site themes and component styles.
Read more >
Build Vue.js UI with Element UI
This is the form for adding and edit movie entries. The template has the Element UI form which has the text inputs for...
Read more >
Element UI Vue Introduction (Component Framework) On ...
Enroll in my Vue Course and get free bonsues! https://bit.ly/2Tt30azElement UI is a neat Vue.js component framework.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found