adonuxt-template icon indicating copy to clipboard operation
adonuxt-template copied to clipboard

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

Open lyquocnam opened this issue 7 years ago • 9 comments

 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)

lyquocnam avatar Jun 07 '17 08:06 lyquocnam

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

hadihallak avatar Jun 13 '17 05:06 hadihallak

Any solution?

vizo avatar Jun 17 '17 13:06 vizo

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]'
        }
      }
    ]
  }

vizo avatar Jun 17 '17 13:06 vizo

@ 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.

elboerse avatar Jun 24 '17 21:06 elboerse

are you missing a semicolon anywhere?

jzucadi avatar Jun 25 '17 03:06 jzucadi

@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 ;-)

elboerse avatar Jun 25 '17 22:06 elboerse

@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()
}

kakajansh avatar Jun 26 '17 00:06 kakajansh

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

elboerse avatar Jun 26 '17 07:06 elboerse

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

thedanotto avatar Jul 22 '17 23:07 thedanotto