Skip to content

Fix TS2305/TS2497: convert Readable import to type-only#99

Open
Copilot wants to merge 1 commit intomainfrom
copilot/fix-js-build-error
Open

Fix TS2305/TS2497: convert Readable import to type-only#99
Copilot wants to merge 1 commit intomainfrom
copilot/fix-js-build-error

Conversation

Copy link

Copilot AI commented Mar 23, 2026

node:stream is a CJS export = module, so named value imports of Readable fail with TS2305 (no exported member) and TS2497 (must reference default export). Since Readable is used solely as a type annotation in readLoop, a value import was never needed.

Changes

  • packages/nanoframe/src/main/core.ts: convert value import to import type, drop node: prefix to avoid module-resolution ambiguity under "moduleResolution": "Bundler"
-import { Readable } from 'node:stream'
+import type { Readable } from 'stream'

import type is exempt from TS2497 — TypeScript resolves named types from export = modules without requiring allowSyntheticDefaultImports.

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