gatsby: Gatsby build failing with Unexpected token error but no other details or stacktrace
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
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
- install dependencies:
yarn - 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)
@LekoArts @flikteoh Hi, I delete the yarn.lock file and the problem has disappeared. I found that
@babel/plugin-transform-react-display-namehas a update. So the problem may caused by it.