gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.19k stars 10.33k forks source link

Build error when upgrading from v3 to v4 #37494

Closed psharma-ii closed 1 year ago

psharma-ii commented 1 year ago

Preliminary Checks

Description

We are running into an issue about webpack and not getting any specific details about what is failing.

Error looks like

failed Validating Rendering Engines - 2.215s

ERROR #98001  WEBPACK

Built Rendering Engines failed validation failed validation.

Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help

  Error: Worker exited before finishing task

  - index.js:117 ChildProcess.<anonymous>
    [PublicSite.MarketingPages]/[gatsby-worker]/dist/index.js:117:45

  - node:events:520 ChildProcess.emit
    node:events:520:28

  - child_process:291 Process.ChildProcess._handle.onexit
    node:internal/child_process:291:12

not finished Running gatsby.IMAGE_CDN jobs - 261.545s
not finished Running gatsby.FILE_CDN jobs - 257.242s

Full Build Log

$ gatsby build --verbose
verbose set gatsby_log_level: "verbose"
verbose set gatsby_executing_command: "build"
verbose loading local command from: /Users/psharma/eMarketerProjects/PublicSite.MarketingPages/node_modules/gatsby/dist/commands/build.js
verbose running command: build
verbose Running build in "production" environment
success compile gatsby files - 0.371s
success load gatsby config - 0.024s
success load plugins - 0.777s
success onPreInit - 0.004s
success initialize cache - 0.116s
success copy gatsby files - 0.143s
success Compiling Gatsby Functions - 0.229s
success onPreBootstrap - 0.244s
verbose Creating 5 worker
success  gatsby-source-wordpress  ensuring plugin requirements are met - 0.760s
⠀
info  gatsby-source-wordpress 

        This is either your first build or the cache was cleared.
        Please wait while your WordPress data is synced to your Gatsby cache.

        Maybe now's a good time to get up and stretch? :D

success  gatsby-source-wordpress  ingest WPGraphQL schema - 1.653s
success createSchemaCustomization - 2.455s
success  gatsby-source-wordpress  fetch root fields - 1.745s
success  gatsby-source-wordpress  Comment - 1.987s - fetched 1
success  gatsby-source-wordpress  ContentType - 3.635s - fetched 5
success  gatsby-source-wordpress  Chart - 3.922s - fetched 10
success  gatsby-source-wordpress  Category - 5.523s - fetched 26
success  gatsby-source-wordpress  Menu - 0.979s - fetched 1
success  gatsby-source-wordpress  PostFormat - 2.026s - fetched 0
success  gatsby-source-wordpress  MenuItem - 2.217s - fetched 3
success  gatsby-source-wordpress  Page - 19.245s - fetched 80
success  gatsby-source-wordpress  Post - 30.626s - fetched 176
success  gatsby-source-wordpress  Taxonomy - 1.186s - fetched 3
success  gatsby-source-wordpress  UserRole - 1.195s - fetched 0
success  gatsby-source-wordpress  Press_release - 4.007s - fetched 14
success  gatsby-source-wordpress  User - 5.334s - fetched 29
success  gatsby-source-wordpress  Tag - 5.626s - fetched 39
success  gatsby-source-wordpress  MediaItem - 204.232s - fetched 121
success  gatsby-source-wordpress  creating nodes - 204.280s
success  gatsby-source-wordpress  fetching nodes - 246.089s - 508 total
success Downloading remote files - 203.070s - 117/117 0.58/s
verbose Checking for deleted pages
verbose Deleted 0 pages
verbose Found 0 changed pages
success Checking for changed pages - 0.010s
success source and transform nodes - 246.248s
info Writing GraphQL type definitions to /Users/psharma/eMarketerProjects/PublicSite.MarketingPages/.cache/schema.gql
success building schema - 0.630s
success createPages - 0.003s
success createPagesStatefully - 0.036s
info Total nodes: 651, SitePage nodes: 1 (use --verbose for breakdown)
verbose Number of node types: 19. Nodes per type: File: 117, Site: 1, SiteBuildMetadata: 1, SitePage: 1, SitePlugin: 26, Wp: 1, WpCategory: 26, WpChart: 10, WpComment: 1, WpContentType: 5, WpMediaItem: 117, WpMenu: 1, WpMenuItem: 3, WpPage: 80, WpPost:
176, WpPress_release: 14, WpTag: 39, WpTaxonomy: 3, WpUser: 29
verbose Checking for deleted pages
verbose Deleted 0 pages
verbose Found 1 changed page
success Checking for changed pages - 0.004s
success onPreExtractQueries - 0.002s
success extract queries from components - 5.914s
success  gatsby-source-wordpress  diff schemas - 5.796s
success  gatsby-source-wordpress  ingest WPGraphQL schema - 5.803s
success write out redirect data - 0.026s
success onPostBootstrap - 0.003s
info bootstrap finished - 259.488s
success write out requires - 0.027s
success Building production JavaScript and CSS bundles - 15.414s
⠹ Building Rendering Engines
[============================]   215.015 s 129/129 100% Running gatsby.IMAGE_CDN jobs
[============================]   210.708 s 37/37 100% Running gatsby.FILE_CDN jobs
⠧ Building Rendering Engines
[============================]   215.015 s 129/129 100% Running gatsby.IMAGE_CDN jobs
[============================]   210.708 s 37/37 100% Running gatsby.FILE_CDN jobs
success Building Rendering Engines - 39.314s
success Building HTML renderer - 4.893s
success Execute page configs - 0.036s
failed Validating Rendering Engines - 2.215s

 ERROR #98001  WEBPACK

Built Rendering Engines failed validation failed validation.

Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help

  Error: Worker exited before finishing task

  - index.js:117 ChildProcess.<anonymous>
    [PublicSite.MarketingPages]/[gatsby-worker]/dist/index.js:117:45

  - node:events:520 ChildProcess.emit
    node:events:520:28

  - child_process:291 Process.ChildProcess._handle.onexit
    node:internal/child_process:291:12

not finished Running gatsby.IMAGE_CDN jobs - 261.545s
not finished Running gatsby.FILE_CDN jobs - 257.242s

error Command failed with exit code 1.

gatsby info

System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Firefox: 108.0.1
    Safari: 15.6.1
  npmPackages:
    gatsby: ^4.24.0 => 4.25.3
    gatsby-plugin-gatsby-cloud: ^4.24.1 => 4.25.0
    gatsby-plugin-image: ^2.24.0 => 2.25.0
    gatsby-plugin-manifest: ^4.24.0  => 4.25.0
    gatsby-plugin-postcss: 5.24.0 => 5.24.0
    gatsby-plugin-react-helmet: ^5.24.0 => 5.25.0
    gatsby-plugin-react-helmet-canonical-urls: ^1.4.0 => 1.4.0
    gatsby-plugin-robots-txt: 1.7.1 => 1.7.1
    gatsby-plugin-sass: ^5.24.0 => 5.25.0
    gatsby-plugin-sharp: ^4.24.0 => 4.25.0
    gatsby-plugin-styled-components: ^5.24.0 => 5.25.0
    gatsby-source-filesystem: ^4.24.0 => 4.25.0
    gatsby-source-wordpress: ^6.24.0 => 6.25.2
    gatsby-transformer-sharp: ^4.24.0 => 4.25.0

Reproduction Link

NA

Steps to Reproduce

1.Have the above configuration

  1. Source data from Wordpress using gatsby-source-wordpress
  2. Build the site ...

Expected Result

Build should be successful

Actual Result

Build fails with the following error


 ERROR #98001  WEBPACK

Built Rendering Engines failed validation failed validation.

Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help

  Error: Worker exited before finishing task

  - index.js:117 ChildProcess.<anonymous>
    [PublicSite.MarketingPages]/[gatsby-worker]/dist/index.js:117:45

  - node:events:520 ChildProcess.emit
    node:events:520:28

  - child_process:291 Process.ChildProcess._handle.onexit
    node:internal/child_process:291:12

not finished Running gatsby.IMAGE_CDN jobs - 261.545s
not finished Running gatsby.FILE_CDN jobs - 257.242s

Environment

System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Firefox: 108.0.1
    Safari: 15.6.1
  npmPackages:
    gatsby: ^4.24.0 => 4.25.3
    gatsby-plugin-gatsby-cloud: ^4.24.1 => 4.25.0
    gatsby-plugin-image: ^2.24.0 => 2.25.0
    gatsby-plugin-manifest: ^4.24.0  => 4.25.0
    gatsby-plugin-postcss: 5.24.0 => 5.24.0
    gatsby-plugin-react-helmet: ^5.24.0 => 5.25.0
    gatsby-plugin-react-helmet-canonical-urls: ^1.4.0 => 1.4.0
    gatsby-plugin-robots-txt: 1.7.1 => 1.7.1
    gatsby-plugin-sass: ^5.24.0 => 5.25.0
    gatsby-plugin-sharp: ^4.24.0 => 4.25.0
    gatsby-plugin-styled-components: ^5.24.0 => 5.25.0
    gatsby-source-filesystem: ^4.24.0 => 4.25.0
    gatsby-source-wordpress: ^6.24.0 => 6.25.2
    gatsby-transformer-sharp: ^4.24.0 => 4.25.0

Config Flags

GATSBY_CPU_COUNT=2 NODE_OPTIONS=--max-old-space-size=16384

LekoArts commented 1 year ago

Hi!

Please create a minimal reproduction so that we can look into it. Also please note that in 5.3 we made this error message more meaningful: https://www.gatsbyjs.com/docs/reference/release-notes/v5.3/#improved-error-messages

So if you can upgrade to Gatsby 5 I'd recommend doing that.

github-actions[bot] commented 1 year ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

LekoArts commented 1 year ago

Hi!

Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks!