nuxt-community / adonuxt-template

[Deprecated] Starter template for Nuxt.js with AdonisJS.
451 stars 61 forks source link

error in ./resources/assets/img/logo.png #45

Open lyquocnam opened 7 years ago

lyquocnam commented 7 years ago
 ERROR  Failed to compile with 1 errors                                           15:29:19

 error  in ./resources/assets/img/logo.png

Module parse failed: /Users/lynam/dev/adonis/test/resources/assets/img/logo.png Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)

 @ ./~/vue-loader/lib/template-compiler?{"id":"data-v-e0c2c1ae","preserveWhitespace":false}!./~/vue-loader/lib/selector.js?type=template&index=0!./resources/layouts/error.vue 6:13-46
 @ ./resources/layouts/error.vue
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js
This question is available on Nuxt.js community (#c36)
hadihallak commented 7 years ago

I can confirm:

Steps to reproduce [on Windows 10]:

  1. adonis new --blueprint nuxt/adonuxt tut
  2. cd tut
  3. npm run serve:dev
 reherh`ERROR`  Failed to compile with 1 errors                                                                       8:24:20 AM

 error  in ./resources/assets/img/logo.png

Module parse failed: C:\Users\Hadi\tut\resources\assets\img\logo.png Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)

 @ ./~/vue-loader/lib/template-compiler?{"id":"data-v-7d49fb04","preserveWhitespace":false}!./~/vue-loader/lib/selector.js?type=template&index=0!./resources/layouts/error.vue 6:13-46
 @ ./resources/layouts/error.vue
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js
vizo commented 7 years ago

Any solution?

vizo commented 7 years ago

in config/nuxt.js add:

build: {
    loaders: [
      {
        test: /\.(png|jpe?g|gif|svg)$/,
        loader: 'url-loader',
        query: {
          limit: 10000, // 10KO
          name: 'img/[name].[hash].[ext]'
        }
      }
    ]
  }
elboerse commented 7 years ago

@ vizo: your solution worked for my problem as well. Only the startpage is still messed up. Do you have an idea? " TypeError (intermediate value).then is not a function "

thx.

jzucadi commented 7 years ago

are you missing a semicolon anywhere?

elboerse commented 7 years ago

@jzucadi I only added the solution from issue #45 to config/nuxt.js

Next try ------ I just started 3rd adonuxt template (followed the steps...)

  1. I got the issue with the png-file (I fixed it with that solution from issue #45),
  2. Then it loaded localhost:3000 with a type-error "(intermediate value).then is not a function app\Http\Controllers\NuxtController.js:13:8

thx. for any help ;-)

kakajansh commented 7 years ago

@elboerse change

this.nuxt = new Nuxt(config)
  .then((nuxt) => {
    this.nuxt = nuxt
    if (config.dev) {
       this.nuxt.build()
    }
  })

to

this.nuxt = new Nuxt(config)

if (config.dev) {
   this.nuxt.build()
}
elboerse commented 7 years ago

@sayawan many thx. It worked for me. Now I can start exploring.... 👍

thedanotto commented 7 years ago

FYI, I had to do suggested changes from both vizo AND sayawan to get the out-of-the-box template rendering.