Skip to content

fix(web3-compat): correct types export path in declaration build#165

Open
tylerthebuildor wants to merge 1 commit intosolana-foundation:mainfrom
tylerthebuildor:fix/web3-compat-types-export
Open

fix(web3-compat): correct types export path in declaration build#165
tylerthebuildor wants to merge 1 commit intosolana-foundation:mainfrom
tylerthebuildor:fix/web3-compat-types-export

Conversation

@tylerthebuildor
Copy link
Copy Markdown

Summary

  • @solana/web3-compat declares its types at ./dist/types/index.d.ts, but the declaration build actually outputs to ./dist/types/web3-compat/src/index.d.ts. TypeScript can't resolve the module without a manual .d.ts shim.
  • The root cause is that tsconfig.declarations.json inherits a paths mapping from tsconfig.json that points @solana/client at raw .ts source files in ../client/src/. This pulls the full client source tree into the program, widening the computed rootDir and nesting the output.
  • Fix: override paths in the declarations tsconfig to resolve @solana/client from its built .d.ts files. This is the same pattern used by react-hooks (added in 6cdb52a).
  • Also adds @solana/web3-compat to the type smoke tests so this gets caught by CI going forward.

Testing

  • pnpm lint
  • pnpm test
  • pnpm build
  • pnpm --filter @solana/test-types-smoke test
  • Verified dist/types/index.d.ts exists after build (previously only dist/types/web3-compat/src/index.d.ts existed)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

@tylerthebuildor is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

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