Summary
All TS client packages generated by stellar scaffold (via npm run dev or equivalent) produce a Vite warning at runtime:
Unable to interop `export * from "@stellar/stellar-sdk"` in
packages/<contract>/dist/index.js, this may lose module exports.
Please export "@stellar/stellar-sdk" as ESM or use named exports instead,
e.g. `export { A, B } from "@stellar/stellar-sdk"`
The "may lose module exports" language suggests potential silent runtime breakage on certain SDK exports. Worth investigating.
Environment
- Stellar CLI: v26.0.0
- stellar-scaffold-cli: v0.0.24
- @stellar/stellar-sdk: (pulled by template)
Steps to Reproduce
stellar scaffold init my-project
cd my-project && npm install && npm run dev
- Wait for clients to generate
- Observe warning in Vite output for each generated package
Suggested fix
Update the client generator template to use named re-exports rather than export *:
// instead of:
export * from "@stellar/stellar-sdk";
// use named exports of what the client actually needs:
export { Contract, rpc, xdr } from "@stellar/stellar-sdk";
Note: would like the maintenance label applied to this issue once it's created in the repo.
Summary
All TS client packages generated by
stellar scaffold(vianpm run devor equivalent) produce a Vite warning at runtime:The "may lose module exports" language suggests potential silent runtime breakage on certain SDK exports. Worth investigating.
Environment
Steps to Reproduce
stellar scaffold init my-projectcd my-project && npm install && npm run devSuggested fix
Update the client generator template to use named re-exports rather than
export *:Note: would like the
maintenancelabel applied to this issue once it's created in the repo.