travis-r6s / gridsome-plugin-flexsearch

Add lightning fast search to Gridsome with FlexSearch
24 stars 7 forks source link

Netlify fails to build "TypeError: Object.fromEntries is not a function" #44

Closed Michael-Brooks closed 4 years ago

Michael-Brooks commented 4 years ago

I have run gridsome build and gridsome develop locally and the search is working fine for me. However, when I go to deploy my site, I get the error "TypeError: Object.fromEntries is not a function" in my Netlify console.

Here's a link to my website's configuration https://github.com/Michael-Brooks/michaelbrooks.co.uk/blob/master/gridsome.config.js

And here's more info to the error from the Netlify console.

4:46:28 PM: TypeError: Object.fromEntries is not a function
4:46:28 PM:     at collectionStore.data.map.node (/opt/build/repo/node_modules/gridsome-plugin-flexsearch/gridsome.server.js:72:26)
4:46:28 PM:     at Array.map (<anonymous>)
4:46:28 PM:     at getStoreCollection (/opt/build/repo/node_modules/gridsome-plugin-flexsearch/gridsome.server.js:56:35)
4:46:28 PM:     at collection (/opt/build/repo/node_modules/gridsome-plugin-flexsearch/gridsome.server.js:122:14)
4:46:28 PM:     at /opt/build/repo/node_modules/gridsome-plugin-flexsearch/node_modules/p-map/index.js:57:28
4:46:28 PM: npm ERR! code ELIFECYCLE
4:46:28 PM: npm ERR! errno 1
4:46:28 PM: npm ERR! gridsome@ build: `gridsome build`
4:46:28 PM: npm ERR! Exit status 1

I would be grateful for any help.

hacknug commented 4 years ago

@Michael-Brooks pretty sure this is due your project using an old Node version. Try adding an .nvmrc file or setting the env variable NODE_VERSION.

Michael-Brooks commented 4 years ago

Haha thank you, I always thought it automatically updated itself which wouldn't really make sense for a lot of people. I've deployed now.