datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

Deploy with Netlify Issue #4

Closed travis-r6s closed 6 years ago

travis-r6s commented 6 years ago

I have a Gatsby project, with Dato CMS here

I can build this locally, and with GItlab Pages, absolutely fine. But when I try to build with Netlify, it throws this error:

1:23:23 PM: error UNHANDLED EXCEPTION
1:23:23 PM: 

  Error: /opt/build/repo/node_modules/gatsby-source-datocms/gatsby-node.js:12
  exports.sourceNodes = async ({ boundActionCreators, getNodes, hasNodeChanged,   store, reporter }, { apiToken }) => {
                              ^
  SyntaxError: Unexpected token (

  - v8-compile-cache.js:226 NativeCompileCache._moduleCompile
    [repo]/[v8-compile-cache]/v8-compile-cache.js:226:18

  - v8-compile-cache.js:172 Module._compile
    [repo]/[v8-compile-cache]/v8-compile-cache.js:172:36

  - module.js:20 require
    internal/module.js:20:19

  - api-runner-node.js:82 runAPI
    [repo]/[gatsby]/dist/utils/api-runner-node.js:82:20

  - api-runner-node.js:178 
    [repo]/[gatsby]/dist/utils/api-runner-node.js:178:33

  - map.js:27 
    [repo]/[async]/internal/map.js:27:9

  - eachOfLimit.js:64 replenish
    [repo]/[async]/internal/eachOfLimit.js:64:17

  - eachOfLimit.js:49 iterateeCallback
    [repo]/[async]/internal/eachOfLimit.js:49:17

  - onlyOnce.js:12 
    [repo]/[async]/internal/onlyOnce.js:12:16

  - map.js:29 
    [repo]/[async]/internal/map.js:29:13

  - util.js:16 tryCatcher
    [repo]/[bluebird]/js/release/util.js:16:23

Any ideas?

travis-r6s commented 6 years ago

My fault again - this plugin obviously only supports Node >8, so I had to set Netlify to use Node 8 with a build variable. https://www.netlify.com/docs/continuous-deployment/#set-node-ruby-or-python-version