creativetimofficial / ct-material-kit-pro

Premium Bootstrap 4 UI Kit based on Google's Material Design
https://www.creative-tim.com/product/material-kit-pro
128 stars 36 forks source link

Webpack Encore loader pb #162

Closed Gompali closed 4 years ago

Gompali commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

I import material-kit.min.css into assets/app.css and then assets/app.css in assets/app.js I was expecting build success

Please describe the behavior you are expecting

Current Behavior

I have an error which shows a pb to load the file

What is the current behavior?

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. you get it...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here.

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 (/srv/app/node_modules/webpack/lib/NormalModule.js:469:19) at /srv/app/node_modules/webpack/lib/NormalModule.js:503:5 at /srv/app/node_modules/webpack/lib/NormalModule.js:358:12 at /srv/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/srv/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at /srv/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4 at /srv/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:85:15 at processTicksAndRejections (internal/process/task_queues.js:75:11) @ ./assets/js/app.js 2:0-24

Gompali commented 4 years ago

found a solution :

yarn add url-loader --dev

in webpack.config.js : added
.addLoader({ test: /.(png|gif|cur|jpg)$/, loader: 'url-loader', query: { limit: 8192 }})

That did the trick