Gatsby: "Module parse failed: Unexpected token (8:11)" when trying to build my project

Created on 24 Jan 2019  路  3Comments  路  Source: gatsbyjs/gatsby

Description

I want to build my website in order to put on live a new version, but the build crash even after I had rollback my edit.

Steps to reproduce

  1. Clone my project on your computer (https://github.com/BlierNicolas/NHU)
  2. Do a little "npm install" to make sure that you have everything related to my project
  3. Do either "npm run build" or "gatsby build" and the build process should start.

Expected result

The build succeeds

Actual result

The build failed and render something like this:
module parse failed

Environment

System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
Binaries:
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.14
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.0.0-rc.28 => 2.0.0-rc.28
gatsby-plugin-google-analytics: ^1.0.31 => 1.0.31
gatsby-plugin-i18n: ^0.4.2 => 0.4.2
gatsby-plugin-manifest: next => 2.0.2-rc.1
gatsby-plugin-offline: ^2.0.21 => 2.0.21
gatsby-plugin-react-helmet: next => 3.0.0-rc.1
gatsby-source-contentful: ^2.0.1 => 2.0.1
gatsby-transformer-remark: ^1.7.44 => 1.7.44

awaiting author response question or discussion

Most helpful comment

You need to update the version of gatsby in your package.json. You're receiving a really old pre 2.0 release version because of your semver. Changing it to ^2.0.0 fixes the issue.

All 3 comments

You need to update the version of gatsby in your package.json. You're receiving a really old pre 2.0 release version because of your semver. Changing it to ^2.0.0 fixes the issue.

Hi, sorry for the delay.

I'm currently looking to apply the potential fix.

Hi again,

I put only ^2.0.0 for Gatsby and did a npm install and the issue seems to have been fixed.

Thanks a lot! :) 馃憤

Was this page helpful?
0 / 5 - 0 ratings