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

fix(gatsby-plugin-typescript): only use resourceQuery for supported version of gatsby #36328

Merged
merged 4 commits into from
Aug 5, 2022

Conversation

marvinjude
Copy link
Contributor

@marvinjude marvinjude commented Aug 5, 2022

Description

Combining newer versions of gatsby-plugin-typescript(>=4.19) with an older version of gatsby(<4.19) leads to the errors like the below

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Unknown option: .resourceQuery. Check out https://babeljs.io/docs/en/babel-core/#options for more
information about options.

File: src/pages/index.tsx

This is happening because older versions of gatsby(<4.19) do not recognize the resourceQuery option.

This PR addresses this by checking if the gatsby version supports it before passing the option

Related Issues

Fixes #36304

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 5, 2022
@marvinjude marvinjude marked this pull request as ready for review August 5, 2022 11:10
@marvinjude marvinjude added topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 5, 2022
marvinjude and others added 2 commits August 5, 2022 12:16
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
@pieh pieh merged commit 564a8f7 into master Aug 5, 2022
@pieh pieh deleted the only-apply-resource-query-on-supported-gatsby-version branch August 5, 2022 13:46
pieh pushed a commit that referenced this pull request Aug 8, 2022
…ersion of gatsby (#36328)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
(cherry picked from commit 564a8f7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed Building production JavaScript and CSS bundles
2 participants