Skip to content

fix: resolve Windows path separator issue in zkit generated types - #79

Open
blastonyz wants to merge 1 commit into
ava-labs:mainfrom
blastonyz:fix/windows-path-separator-zkit-generated-types
Open

fix: resolve Windows path separator issue in zkit generated types#79
blastonyz wants to merge 1 commit into
ava-labs:mainfrom
blastonyz:fix/windows-path-separator-zkit-generated-types

Conversation

@blastonyz

Copy link
Copy Markdown

Problem
Running npm run compile on Windows fails with:

Error: Cannot find module '..helpers'
@solarity/zktype uses path.relative() for helper imports in generated .ts files. On Windows that produces backslashes (from "..\helpers"), which Node cannot resolve.

The existing postinstall script also used cmd & instead of sequential execution, breaking the compile chain on Windows.

Fix
scripts/fix-win-paths.js — normalize \ → / in generated-types/zkit/**/.ts after zkit make
scripts/run-compile.cjs — cross-platform sequential compile pipeline
scripts/zkit-require-alias.cjs + scripts/run-zkit-verifiers.cjs — fallback during verifier generation
package.json — compile, postinstall, and zkit:
scripts
Testing
npm run compile on Windows 11 — 5 circuits compiled, 5 verifiers generated
macOS/Linux (expected no-op when paths already use /)
Related
Upstream: @solarity/zktype ZkitTSGenerator.ts → path.relative without POSIX normalization.

Normalize backslash import paths from @solarity/zktype on Windows and replace cmd & postinstall chaining with a cross-platform compile runner.

Fixes: Error Cannot find module ..helpers during hardhat zkit verifiers.
Co-authored-by: Cursor <cursoragent@cursor.com>
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