gatsby: Gatsby build failing with Unexpected token error but no other details or stacktrace

Preliminary Checks

Description

It works well in development mode, but build fail and there is no other error details.

failed Building production JavaScript and CSS bundles - 1.742s

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Unexpected token (12:287)

File: .cache/production-app.js:12:287

Reproduction Link

https://github.com/chhpt/gatsby-ts-starter

Steps to Reproduce

  1. install dependencies: yarn
  2. yarn run build

Expected Result

Build success

Actual Result

Build fail

Environment

macOS 11.5, node 14.16.0, npm 6.14.11

Config Flags

No

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 18 (5 by maintainers)

Most upvoted comments

@LekoArts @flikteoh Hi, I delete the yarn.lock file and the problem has disappeared. I found that @babel/plugin-transform-react-display-name has a update. So the problem may caused by it.