Skip to content

fix: mark type-only re-exports so isolated-module runtimes can load the source - #39

Merged
robocode13 merged 2 commits into
robocode13:mainfrom
mircoservices:fix/type-only-exports
Sep 15, 2026
Merged

robocode13 merged 2 commits into
robocode13:mainfrom
mircoservices:fix/type-only-exports

Conversation

@mircoservices

Copy link
Copy Markdown
Contributor

Problem

Importing src/index.ts directly under Bun 1.3 (or any consumer transpiling with isolatedModules / verbatimModuleSyntax) fails at load time:

SyntaxError: export 'Statement' not found in './statement.js'

Bun strips interface exports per file, so a plain export { Statement } of a type has nothing to bind to at runtime. tsc with verbatimModuleSyntax reports the same lines as TS1205/TS1484.

Fix

Mark the affected re-exports as export type / import type:

  • src/index.ts: AccountBalanceResponse, ClientResponse, StatementResponse, ElectronicStatementOptions, ElectronicStatementResponse, PortfolioResponse
  • src/mt940parser.ts: Balance, Statement, Transaction

No behaviour change for the compiled dist/ build. vitest run: 29 files, 165 tests pass.

Found while wiring the library into a Bun app to test against a Sparkasse; will report on that separately.

mircoservices and others added 2 commits September 14, 2026 23:28
…he source

Bun (and any transpiler running with isolatedModules / verbatimModuleSyntax)
strips interface exports per file, so a plain re-export of a type fails at
load time with e.g. "export 'Statement' not found in './statement.js'".
Found by importing src/index.ts directly under Bun 1.3.
@robocode13

Copy link
Copy Markdown
Owner

Thanks for the contribution. I enabled isolatedModules in tsconfig also.

@robocode13
robocode13 merged commit fddd4b7 into robocode13:main Sep 15, 2026
3 checks passed
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.

2 participants