Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR #98123: Generating development JavaScript bundle failed v2.31.1 #29213

Closed
charliequin opened this issue Jan 26, 2021 · 3 comments
Closed
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@charliequin
Copy link

charliequin commented Jan 26, 2021

Description

Recently upgraded our site to run gatsby 2.31.1. from 2.27.4 and noticed our CMS previews in Gatsby Cloud seemed to be cancelled. Taking a look into the issue further I logged a ticket with Gatsby Cloud to take a look, this is what their response from one of their devs was:

image

I then reverted the version to run from our previously working one, which seemed fine when I was running locally.

Errors

image

Steps to reproduce

At the time of writing this ticket I'm riddled with console errors when running yarn develop; gatsby build && gatsby serve seems to build completely fine and our production builds still seem to build and deploy without errors, yet the CMS previews and local development are erroring.

{
  "scripts": {
    "build": "rm -rf public/ && gatsby build",
    "clean": "gatsby clean",
    "dev": "gatsby develop --port 9010",
    "cy:open": "cypress open",
    "cy:run": "cypress run",
    "format": "prettier --write '**/*.js'",
    "lint": "eslint --ext .js,.jsx src",
    "lint:ci": "mkdir -p ./test-reports && eslint --ext .js,.jsx --format junit src > ./test-reports/eslint-junit.xml"
  },
  "dependencies": {
    "@contentful/gatsby-transformer-contentful-richtext": "^13.1.0",
    "@contentful/rich-text-types": "^14.1.2",
    "@elastic/apm-rum": "^5.6.2",
    "babel-eslint": "^10.1.0",
    "date-fns": "^2.16.1",
    "dotenv": "^8.2.0",
    "eslint-plugin-react": "^7.22.0",
    "formik": "^2.2.6",
    "gatsby": "^2.31.1",
    "gatsby-image": "^2.9.0",
    "gatsby-plugin-catch-links": "^2.3.15",
    "gatsby-plugin-google-tagmanager": "^2.6.0",
    "gatsby-plugin-hotjar": "^1.1.1",
    "gatsby-plugin-manifest": "^2.11.0",
    "gatsby-plugin-offline": "^3.9.0",
    "gatsby-plugin-react-helmet": "^3.5.0",
    "gatsby-plugin-robots-txt": "^1.5.5",
    "gatsby-plugin-sharp": "^2.9.0",
    "gatsby-plugin-sitemap": "^2.10.0",
    "gatsby-plugin-styled-components": "^3.8.0",
    "gatsby-source-contentful": "^3.1.3",
    "gatsby-source-filesystem": "^2.10.0",
    "gatsby-transformer-sharp": "^2.10.1",
    "idx": "^2.5.6",
    "logrocket": "^1.0.9",
    "polished": "^4.0.5",
    "prop-types": "^15.7.2",
    "pure-react-carousel": "^1.27.6",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-helmet": "^6.1.0",
    "react-lazyload": "^3.1.0",
    "react-player": "^2.7.0",
    "styled-components": "^5.2.1",
    "tiny-cookie": "^2.3.2",
    "yup": "^0.31.0"
  },
  "devDependencies": {
    "cypress": "^5.5.0",
    "eslint": "^7.14.0",
    "eslint-config-prettier": "^7.2.0",
    "eslint-loader": "^4.0.2",
    "eslint-plugin-babel": "^5.3.1",
    "eslint-plugin-cypress": "^2.11.2",
    "eslint-plugin-prettier": "^3.1.4",
    "framer-motion": "^2.9.4",
    "gatsby-plugin-eslint": "^2.0.8",
    "gatsby-plugin-remove-trailing-slashes": "^2.5.0",
    "miragejs": "^0.1.41",
    "prettier": "2.1.2",
    "react-router-dom": "^5.2.0",
    "react-use": "^15.3.8",
    "start-server-and-test": "^1.11.6"
  },
  "resolutions": {
    "sharp": "0.24.0"
  },
}

Expected result

The local development environment of gatsby should spin up, and I believe had been working as of last week.

Actual result

Continually met with persistent errors when trying to build locally.

@charliequin charliequin added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 26, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 26, 2021
@charliequin charliequin changed the title ERROR #98123: Generating development JavaScript bundle failed ERROR #98123: Generating development JavaScript bundle failed v2.31.1 Jan 26, 2021
@charliequin
Copy link
Author

charliequin commented Jan 26, 2021

Temporary workaround 🔧

I was running "react": "^17.0.1" and "react-dom": "^17.0.1" at the time of writing this ticket, but seemingly after reverting to "react": "^16.14.0" and "react-dom": "^16.14.0" and dropping "eslint-loader": "^4.0.2" to "eslint-loader": "^3.0.4" it finally managed to build develop locally.

@dangkyokhoang
Copy link

I also encounter this issue when upgrading gatsby from 2.30.3 to 2.31.1.

{
  "dependencies": {
    "gatsby": "^2.31.1",
    "gatsby-plugin-google-analytics": "^2.10.0",
    "gatsby-plugin-react-helmet": "^3.9.0",
    "gatsby-plugin-sass": "^3.1.0",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-helmet": "^6.1.0",
    "sass": "^1.32.5"
  }
}

My workaround is to downgrade gatsby back to 2.30.3 and it's working again.

    "gatsby": "2.30.3"

@LekoArts
Copy link
Contributor

LekoArts commented Jan 27, 2021

Hi, thanks for the issue! This sounds like a duplicate of #29133. A PR to fix this is on its way: #29130

For now sticking to 2.30 will unblock you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants