adonuxt-template
adonuxt-template copied to clipboard
error in ./resources/assets/img/logo.png
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
I can confirm:
Steps to reproduce [on Windows 10]:
- adonis new --blueprint nuxt/adonuxt tut
- cd tut
- 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
Any solution?
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: 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.
are you missing a semicolon anywhere?
@jzucadi I only added the solution from issue #45 to config/nuxt.js
Next try ------ I just started 3rd adonuxt template (followed the steps...)
- I got the issue with the png-file (I fixed it with that solution from issue #45),
- 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 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()
}
@sayawan many thx. It worked for me. Now I can start exploring.... 👍
FYI, I had to do suggested changes from both vizo AND sayawan to get the out-of-the-box template rendering.