pimlie / nuxt-rfg-icon

Automatically generate favicon's and app icon's using RealFaviconGenerator
Other
89 stars 5 forks source link

TypeError: Cannot read property 'buff' of undefined @ index.js:256:48 #3

Closed kirillbunin closed 6 years ago

kirillbunin commented 6 years ago

My stack: package.json

    "@nuxtjs/axios": "^5.1.1",
    "@nuxtjs/manifest": "^2.1.0",
    "nuxt": "^1.4.0",
    "nuxt-rfg-icon": "^0.4.0

nuxt.config.js

  modules: [
    '@nuxtjs/axios',
    ['nuxt-rfg-icon', { masterPicture: 'assets/favicon-big.png' }],
    '@nuxtjs/manifest'
  ]

I get this error on build:

  plugin:nuxt-rfg-icon Retrieving favicons from realfavicongenerator api +0ms
  plugin:nuxt-rfg-icon error while communicating with rfg api TypeError: Cannot read property 'buff' of undefined
    at axios.post.then.then.then (D:\Work\Projects\patron\patron\node_modules\nuxt-rfg-icon\index.js:256:48)
    at <anonymous> +19s

https://github.com/pimlie/nuxt-rfg-icon/blob/9e332340255279d2ea1c3cc520549fc4b9677a4d/index.js#L255-L256

Not sure how to debug this, i figure the module has a problem reading manifest file?

pimlie commented 6 years ago

It seems there was a problem with the zip file downloaded form the rfg api. That zip file should contain a manifest.json describing the generated favicon files and the files themselves. In your case it appears the zip file doesnt contain that manifest or maybe is empty.

Could you try to generate the favicons on the rfg website and see if that works? https://realfavicongenerator.net/

kirillbunin commented 6 years ago

No, instead it contains site.webmanifest. Apparently the API now returns "new & lighter" package https://realfavicongenerator.net/blog/new-favicon-package-less-is-more/

pimlie commented 6 years ago

Thanks for checking, can you confirm that v0.4.1 solves this?

Btw, that blog post is actually from 2016 already so I am not sure why/how that file is renamed in the zip ;)

kirillbunin commented 6 years ago

I've noticed that the blog post is outdated bit after posting it too :D Couldn't find a changelog for when they changed to .webmanifest. Either way, it works now! For some reason Chrome doesn't load the icon now (unlike Safari, and Edge). But i don't think thats related here. I'll investigate later and I'm going to report it where it applies. Thanks for a quick fix!

avblink commented 5 years ago

Not working for me. API does not return manifest.json file