`hydrogen gql check` fails on Windows: absolute schema path is parsed as a URL by gql.tada

Open
#4,359 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@Roshan931 is already working on this.

Since Nov 11, 2026.

  • #4361 by @Roshan931 — open
  • #4367 by @Peerapatfc — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
30/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
graphql, node.js, typescript

Research direction

Start with packages/hydrogen/src/cli/gql.ts, where the issue says the CLI builds the temporary gql.tada config, and trace how it determines the tsconfig path and schema paths. Reproduce the failure on Windows with npx hydrogen gql check; compare the absolute schema path with the working relative path described in the issue. Done means the check validates the bundled schemas on Windows, as it does on Linux and macOS.

Written by the indexing model from the issue text.

Description

Environment

  • Windows 11, Node 26, @shopify/hydrogen 2026.10.2 (2026.10.3 and main have the same code)
  • gql.tada 1.9.2, @gql.tada/internal 1.0.9

Steps

  1. Create or migrate a Hydrogen project on Windows with @shopify/hydrogen 2026.10.x.
  2. Run npx hydrogen gql check.

Actual

⚠ Unexpected Error
Could not check files
┗ CombinedError: [Network] fetch failed

The CLI writes a temporary tsconfig and runs gql.tada check on it.

Expected: the check validates the gql() documents against the bundled schemas, as on Linux and macOS.

Cause: packages/hydrogen/src/cli/gql.ts builds the plugin config with createGraphQLPluginConfig(join(packageRoot, "dist")), so schema is an absolute path such as C:\...\storefront.schema.json. gql.tada's getURLConfig runs new URL(schema) before deciding the schema is a file. On Windows that call succeeds (new URL("C:\dev\x\storefront.schema.json").protocol === "c:"), so the schema is loaded as a remote URL and the fetch fails.

Verified workaround / possible fix: with the same tsconfig but schema set to a path relative to the tsconfig (./node_modules/@shopify/hydrogen/dist/storefront.schema.json), gql.tada check prints "No problems found". Changing only those paths to absolute reproduces the error. So the CLI could pass path.relative(dirname(tsconfigPath), …) with forward slashes; new URL throws on that and gql.tada falls back to reading the file.

Impact: hydrogen gql check, which the Hydrogen skills chain into typecheck, cannot run on Windows. We validate locally with a hand-made tsconfig. That check caught a real error: $discountCodes is [String!]! in this API version.

Dominant language
TypeScript
Stars
2.2k
Forks
466
Avg merge
3d 18h
Merged PRs (30d)
59

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Shopify/hydrogen

All issues in Shopify/hydrogen

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.