gatsby: Unexpected Rendering Engines validation failure (Gatsby v4)

Preliminary Checks

Description

After migrating to Gatsby v4, build fails with:

failed Validating Rendering Engines - 0.641s

 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: Generated engines use disallowed import "babel-runtime/helpers/asyncToGenerator". Only allowed imports are to Node.js builtin modules or engines internals.

I don’t know Gatsby’s internals but it looks like that import is intentional and coming from Gatsby itself: https://github.com/gatsbyjs/gatsby/pull/33030/files#diff-53a98e8932749e1788143dca477bd89b34e3f53d2db77569afac21ddede8f8a4R36

Is that an indication of a bug in Gatsby?

Reproduction Link

https://github.com/gkossakowski/gkossakowski.github.io/tree/gatsby-v4

Steps to Reproduce

  1. Checkout the repo
  2. Run gatsby build

Expected Result

Builds successfully.

Actual Result

Error: Generated engines use disallowed import “babel-runtime/helpers/asyncToGenerator”. Only allowed imports are to Node.js builtin modules or engines internals.

Environment

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.2.0 - /opt/homebrew/bin/node
    Yarn: 3.1.1 - /opt/homebrew/bin/yarn
    npm: 8.1.4 - /opt/homebrew/bin/npm
  Languages:
    Python: 3.7.6 - /Users/grek/opt/miniconda3/bin/python
  Browsers:
    Chrome: 96.0.4664.110
    Safari: 15.2
  npmPackages:
    gatsby: ^4.4.0 => 4.4.0
    gatsby-cli: ^4.4.0 => 4.4.0
    gatsby-link: ^4.4.0 => 4.4.0
    gatsby-plugin-catch-links: ^4.4.0 => 4.4.0
    gatsby-plugin-feed: ^4.4.0 => 4.4.0
    gatsby-plugin-flow: ^3.4.0 => 3.4.0
    gatsby-plugin-google-gtag: ^4.4.0 => 4.4.0
    gatsby-plugin-manifest: ^4.4.0 => 4.4.0
    gatsby-plugin-netlify: next => 4.0.0-next.0
    gatsby-plugin-netlify-cms: ^6.4.0 => 6.4.0
    gatsby-plugin-netlify-cms-paths: ^1.3.0 => 1.3.0
    gatsby-plugin-offline: ^5.4.0 => 5.4.0
    gatsby-plugin-optimize-svgs: ^1.0.5 => 1.0.5
    gatsby-plugin-react-helmet: ^5.4.0 => 5.4.0
    gatsby-plugin-sass: ^5.4.0 => 5.4.0
    gatsby-plugin-sharp: ^4.4.0 => 4.4.0
    gatsby-plugin-sitemap: ^5.4.0 => 5.4.0
    gatsby-remark-autolink-headers: ^5.4.0 => 5.4.0
    gatsby-remark-copy-linked-files: ^5.4.0 => 5.4.0
    gatsby-remark-external-links: 0.0.4 => 0.0.4
    gatsby-remark-images: ^6.4.0 => 6.4.0
    gatsby-remark-katex: ^6.4.0 => 6.4.0
    gatsby-remark-prismjs: ^6.4.0 => 6.4.0
    gatsby-remark-relative-images: ^2.0.2 => 2.0.2
    gatsby-remark-responsive-iframe: ^5.4.0 => 5.4.0
    gatsby-remark-smartypants: ^5.4.0 => 5.4.0
    gatsby-source-filesystem: ^4.4.0 => 4.4.0
    gatsby-transformer-remark: ^5.4.0 => 5.4.0
    gatsby-transformer-sharp: ^4.4.0 => 4.4.0

Config Flags

No response

About this issue

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

Most upvoted comments

I’m trying to use the Deferred Static Generation (DSG) on some templates, but as soon as I add defer: true on createPage, I get a very similar error. Node 16.13.0

Screenshot 2022-03-04 at 14 13 15
"gatsby": "^4.9.1",
"gatsby-plugin-catch-links": "^4.9.0",
"gatsby-plugin-exclude": "^1.0.2",
"gatsby-plugin-feed": "^4.9.0",
"gatsby-plugin-manifest": "^4.9.0",
"gatsby-plugin-netlify": "^4.1.0",
"gatsby-plugin-polyfill-io": "^1.1.0",
"gatsby-plugin-preconnect": "^1.3.0",
"gatsby-plugin-react-helmet": "^5.9.0",
"gatsby-plugin-remove-fingerprints": "0.0.2",
"gatsby-plugin-remove-serviceworker": "^1.0.0",
"gatsby-plugin-sitemap": "^5.9.0",
"gatsby-plugin-styled-components": "^5.9.0",
"gatsby-source-filesystem": "^4.9.0",
"gatsby-source-graphql": "^4.9.0",
"gatsby-transformer-json": "^4.9.0",
"gatsby-transformer-remark": "^5.9.0",
"gatsby-plugin-force-trailing-slashes": "^1.0.6",
"gatsby-plugin-root-import": "^2.0.8",
"gatsby-plugin-sharp": "^4.9.0",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.25",
"babel-preset-gatsby": "^2.1.0",

Not exactly sure what’s going on or if it’s somehow related to the original issue. Happy to provide more context!