Skip to content

Fix: Resolve glob expansion issue in build script on Windows#836

Open
JavanPoirier wants to merge 1 commit intosolidjs-community:mainfrom
JavanPoirier:fix-build-windows
Open

Fix: Resolve glob expansion issue in build script on Windows#836
JavanPoirier wants to merge 1 commit intosolidjs-community:mainfrom
JavanPoirier:fix-build-windows

Conversation

@JavanPoirier
Copy link
Contributor

Fix: Resolve glob expansion issue in build script on Windows

Problem

The build script was failing on Windows with Git Bash (MINGW64) with the error:
error TS5083: Cannot read file 'D:/Repos/solid-primitives/packages/*/tsconfig.json'.

Root Cause

The tsc -b packages/* command relied on shell glob expansion to pass all package directories to TypeScript. However, when using shell: true with child_process.spawn() on Windows, the glob pattern packages/* was not being expanded and was passed literally to TypeScript, which tried to read a file path containing an asterisk.

Solution

Modified the build script to explicitly read and expand the packages directory before spawning the TypeScript compiler:

  • Read the packages directory using fs.readdir()
  • Filter out hidden files (starting with .)
  • Map directory names to proper paths (packages/{name})
  • Spread the expanded paths directly into the tsc command arguments

This ensures the command receives actual paths like tsc -b packages/active-element packages/analytics ... instead of relying on shell glob expansion.

Benefits

  • ✅ Fixes build failures on Windows with Git Bash
  • ✅ Improves cross-platform consistency by removing dependency on shell-specific glob behavior
  • ✅ No changes to functionality - all package directories are correctly passed to TypeScript compiler
  • ✅ Works identically on Unix, Windows, and macOS

Testing

Verified that pnpm generate now completes successfully on Windows.

@changeset-bot
Copy link

changeset-bot bot commented Mar 1, 2026

⚠️ No Changeset found

Latest commit: f8bb2a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant