gatsby: Missing class properties transform
Description
The build command crashes after updating to v3.7:
yarn run v1.19.1
$ gatsby build --verbose
verbose set gatsby_log_level: "verbose"
verbose set gatsby_executing_command: "build"
verbose loading local command from: /tlp-website/node_modules/gatsby/dist/commands/build.js
verbose running command: build
success open and validate gatsby-configs - 2.571s
success load plugins - 5.280s
success onPreInit - 0.050s
info One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's no stale data.
success initialize cache - 2.482s
success copy gatsby files - 0.121s
verbose Attaching functions to development server
success Compiling Gatsby Functions - 0.615s
success onPreBootstrap - 1.559s
success createSchemaCustomization - 0.180s
verbose Checking for deleted pages
verbose Deleted 0 pages
verbose Found 0 changed pages
success Checking for changed pages - 0.004s
success source and transform nodes - 0.710s
success building schema - 0.636s
success createPages - 23.034s
verbose PageCreator: Creating 4 pages from {MarkdownRemark.frontmatter__slug}.tsx
success createPagesStatefully - 0.099s
info Total nodes: 8769, SitePage nodes: 8696 (use --verbose for breakdown)
verbose Number of node types: 9. Nodes per type: Directory: 3, File: 15, GraphQLSource: 1, ImageSharp: 3, MarkdownRemark: 4, Site: 1, SiteBuildMetadata: 1, SitePage: 8696,
SitePlugin: 45
verbose Checking for deleted pages
verbose Deleted 0 pages
verbose Found 8696 changed pages
success Checking for changed pages - 0.004s
success Cleaning up stale page-data - 0.271s
success update schema - 15.253s
success onPreExtractQueries - 0.001s
success extract queries from components - 0.950s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.075s
success onPostBootstrap - 0.079s
info bootstrap finished - 62.397s
success run static queries - 0.389s - 2/2 5.15/s
success run page queries - 5.268s - 8696/8696 1650.84/s
success write out requires - 0.033s
failed Building production JavaScript and CSS bundles - 84.844s
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
/tlp-website/.cache/loader.js: Missing class properties transform.
101 | }
102 |
> 103 | inFlightNetworkRequests = new Map()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104 |
105 | memoizedGet(url) {
106 | let inFlightPromise = this.inFlightNetworkRequests.get(url)
File: .cache/loader.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Steps to reproduce
I updated from "gatsby": "^3.6.2" => "gatsby": "^3.7.0" and ran into this issue. Not sure what is causing it yet.
I see that there’s been some updates to configs in this release, and I do export a config:
// gatsby-node
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
path: require.resolve("path-browserify"),
},
fallback: {
fs: false,
},
},
})
}
The crash does however persist if I remove this config.
Expected result
Gatsby should build without issues.
Actual result
The build crashes with what looks like a babel issue? Not 100% sure what’s causing it yet.
Environment
System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.10 - ~/tlp-website/node_modules/.bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Languages:
Python: 3.7.1 - /Users/jonathan/anaconda3/bin/python
Browsers:
Safari: 14.1.1
npmPackages:
gatsby: ^3.7.0 => 3.7.0
gatsby-image: ^3.7.0 => 3.7.0
gatsby-plugin-advanced-sitemap: ^2.0.0 => 2.0.0
gatsby-plugin-codegen: ^1.3.0-next => 1.3.0-next
gatsby-plugin-google-tagmanager: ^3.7.0 => 3.7.0
gatsby-plugin-manifest: ^3.7.0 => 3.7.0
gatsby-plugin-material-ui: ^3.0.1 => 3.0.1
gatsby-plugin-offline: ^4.7.0 => 4.7.0
gatsby-plugin-react-helmet: ^4.7.0 => 4.7.0
gatsby-plugin-sharp: ^3.7.0 => 3.7.0
gatsby-plugin-webfonts: ^2.1.0 => 2.1.0
gatsby-remark-autolink-headers: ^4.4.0 => 4.4.0
gatsby-source-filesystem: ^3.7.0 => 3.7.0
gatsby-source-graphql: ^3.7.0 => 3.7.0
gatsby-transformer-remark: ^4.4.0 => 4.4.0
gatsby-transformer-sharp: ^3.7.0 => 3.7.0
No flags in my gatsby-config
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 20 (6 by maintainers)
Commits related to this issue
- fix: yarn deduplicate Executed `yarn-deduplicate && yarn` as it was suggested in https://github.com/gatsbyjs/gatsby/issues/31853#issuecomment-967911798 to fix a gatsby/webpack error described in http... — committed to AmazeeLabs/silverback-mono by Leksat 3 years ago
- fix: yarn deduplicate Executed `yarn-deduplicate && yarn` as it was suggested in https://github.com/gatsbyjs/gatsby/issues/31853#issuecomment-967911798 to fix a gatsby/webpack error described in http... — committed to AmazeeLabs/silverback-mono by Leksat 3 years ago
For now one workaround to try: remove
yarn.lock(orpackage-lock.json) and re-install dependencies.Got rid of the error via
yarn-deduplicate && yarn😃Facing the same issue and can confirm that the workaround proposed by @vladar works perfect:
The fix is published in
gatsby@3.7.1the solution was adding a .babelrc with
Reporting same as above when updating from
3.12.1to3.14.5. (Workaround resolves it.)thanks works for me
I’ve got no idea why removing the lock file works but hey, it really works!
Just wanted to point out that it seems this issue wasn’t entirely fixed in
3.7.1I am currently using version
3.10.1and just hit this same issue. However, the workaround did work for me. Simply reinstalling the packages worked 🤷But yeah, looks like this issue may have come back up 😕
I’m having the same issue with gatsby 3.10.1 inside a pnpm monorepo. When I go into
babel-preset-gatsby/index.js, I’m able to log out the returned babel config whereplugin-proposal-class-propertieswas successfully resolved. Deleting thepnpm-lock.yamland reinstall all dependencies didn’t work for me 😢