Creatiwity / gatsby-plugin-favicon

UNMAINTAINED - Favicon Gatsby plugin
MIT License
166 stars 27 forks source link

Error with the ES6 spread operator #36

Closed emilioponce closed 6 years ago

emilioponce commented 6 years ago

Hi, thanks for your effort with this plugin.

I've installed the plugin and after a 'gatsby develop' I found that there's no support for the spread operator, the error:

Error: /Users/emilio/Desktop/blog/node_modules/gatsby-plugin-favicon/gatsby-node.js:58 ...icons, SyntaxError: Unexpected token ... Some data: Macbook Pro, VSCODE

julien1619 commented 6 years ago

What's your version of Node.js?

emilioponce commented 6 years ago

node v6.9.4 npm 6.2.0

julien1619 commented 6 years ago

Ok thanks. I've only tested the last version of the plugin on the last versions of Node.js. To support it, I'll have to slightly rewrite the merging of default values and options. I'll let you know when it's available.

julien1619 commented 6 years ago

@emilioponce I've just pushed a fix on the develop branch. Can you test it? Thank you!

emilioponce commented 6 years ago

Sorry not working:

error There was an error compiling the html.js component for the development server. See our docs page on debugging HTML builds for help https://goo.gl/yL9lND Error: ENOENT: no such file or directory, open '/Users/emilio/Desktop/blog/public/.iconstats.json'

julien1619 commented 6 years ago

Are you using Gatsby v2? The last major version of this plugin is only compatible with Gatsby v2.

emilioponce commented 6 years ago

Ok, that's the problem then. I'm using Gatsby v1 as v2 is still in beta

julien1619 commented 6 years ago

Ok great! I will add a mention about this compatibility issue in the README.

julien1619 commented 6 years ago

Finally I've added backward compatibility on the develop branch, can you test it again? I'll release it today if it's working.

emilioponce commented 6 years ago

Ok I'll try today and I give you feedback, but in Linux with node v8.11.3 LTS & Gatsby v1.

(forget the comment about the --save option, my mistake)

emilioponce commented 6 years ago

Not working with node v8.11.3 TLS & Gatsby v1.1.58. ` 71 | @internal 72 | /

73 | enqueueReplaceState: function (publicInstance, completeState) { | ^ 74 | warnNoop(publicInstance, 'replaceState'); 75 | }, 76 |

WebpackError: ENOENT: no such file or directory, open '/home/epa/Escritorio/blog/public/.iconstats.json' `

julien1619 commented 6 years ago

My colleague has just tested it and it works but not the first time. It seems that the build was done in a different order on Gatsby v1.x, so the file exists but later. I will see what can be done to fix it. I'll keep you in touch. Thanks again!