GatsbyThemeComponentShadowingResolverPlugin fails to match shadowed components if the theme adds query params #37925
Labels
status: confirmed
Issue with steps to reproduce the bug that’s been verified by at least one reviewer.
topic: core
Relates to Gatsby's core (e.g. page loading, reporter, state machine)
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
This theme uses a query param on the component path... which is completely acceptable for Webpack... but the shadow resolver does not match it...
https://github.com/LekoArts/gatsby-themes/blob/main/themes/gatsby-theme-minimal-blog-core/gatsby-node.mjs#L348
The resolver should ignore the query params when comparing file paths.
Reproduction Link
https://github.com/jsg2021/gatsby-starter-minimal-blog-shadow-reproduction
Steps to Reproduce
post-query.tsx
:In the new copied file, replace
import HomepageComponent, { Head } from '.../components/post';
withimport HomepageComponent, { Head } from '@lekoarts/gatsby-theme-minimal-blog-core/src/components/post';
Expected Result
The shadowed content is used and this warning should be printed:
Actual Result
The original content is used and instead this console message is printed:
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: