Summary
@salesforce/core's published type declarations reference pino.TransportSingleOptions in a way that fails tsc when library checking is enabled (skipLibCheck: false). Consumers that lib-check are forced to enable skipLibCheck to build.
Error
node_modules/@salesforce/core/lib/logger/logger.d.ts(262,63): error TS2694: Namespace 'pino.pino' has no exported member 'TransportSingleOptions'.
Root cause
lib/logger/logger.d.ts does:
import { type Logger as PinoLogger, pino } from 'pino';
// ...
export declare const getWriteStream: (level?: string) => pino.TransportSingleOptions;
pino's pino.d.ts uses export = pino with an outer declare namespace pino (where TransportSingleOptions is declared) and also a nested namespace pino inside it. The named import binding { pino } resolves to the inner pino.pino namespace, which does not contain TransportSingleOptions — hence TS2694: Namespace 'pino.pino' has no exported member 'TransportSingleOptions'.
The fix is likely to reference the type off the default/export = binding rather than the named pino import, e.g. use the outer namespace type (import type pino from 'pino' / pino.TransportSingleOptions) or import TransportSingleOptions directly.
Version bisect
@salesforce/core |
logger.d.ts line 1 import |
References pino.TransportSingleOptions? |
lib-check |
| 8.31.3 |
import { type Logger as PinoLogger } from 'pino'; |
No |
✅ clean |
| 8.32.6 |
import { type Logger as PinoLogger, pino } from 'pino'; |
Yes (line 262) |
❌ TS2694 |
| 9.1.0 |
import { type Logger as PinoLogger, pino } from 'pino'; |
Yes (line 262) |
❌ TS2694 |
The regression was introduced in the 8.32.x line and persists in 9.1.0. pino resolved version at repro: pino@9.14.0.
Reproduction
npm i @salesforce/core@9.1.0
- In a
tsconfig.json with skipLibCheck unset/false and moduleResolution: NodeNext, run tsc --noEmit.
- Observe the TS2694 error above (the only error; it originates entirely inside
@salesforce/core's .d.ts).
Impact
Downstream TypeScript consumers of @salesforce/core that keep skipLibCheck: false (the stricter, recommended setting) cannot compile without enabling skipLibCheck, which then disables .d.ts checking for all dependencies. A correct type declaration here would let consumers keep strict library checks.
Environment
@salesforce/core: 9.1.0 (and 8.32.6)
pino: 9.14.0
typescript: 6.0.3 (also reproduces on 7.0.2)
moduleResolution: NodeNext
Summary
@salesforce/core's published type declarations referencepino.TransportSingleOptionsin a way that failstscwhen library checking is enabled (skipLibCheck: false). Consumers that lib-check are forced to enableskipLibCheckto build.Error
Root cause
lib/logger/logger.d.tsdoes:pino's
pino.d.tsusesexport = pinowith an outerdeclare namespace pino(whereTransportSingleOptionsis declared) and also a nestednamespace pinoinside it. The named import binding{ pino }resolves to the innerpino.pinonamespace, which does not containTransportSingleOptions— henceTS2694: Namespace 'pino.pino' has no exported member 'TransportSingleOptions'.The fix is likely to reference the type off the default/
export =binding rather than the namedpinoimport, e.g. use the outer namespace type (import type pino from 'pino'/pino.TransportSingleOptions) or importTransportSingleOptionsdirectly.Version bisect
@salesforce/corelogger.d.tsline 1 importpino.TransportSingleOptions?import { type Logger as PinoLogger } from 'pino';import { type Logger as PinoLogger, pino } from 'pino';import { type Logger as PinoLogger, pino } from 'pino';The regression was introduced in the 8.32.x line and persists in 9.1.0. pino resolved version at repro:
pino@9.14.0.Reproduction
npm i @salesforce/core@9.1.0tsconfig.jsonwithskipLibCheckunset/false andmoduleResolution: NodeNext, runtsc --noEmit.@salesforce/core's.d.ts).Impact
Downstream TypeScript consumers of
@salesforce/corethat keepskipLibCheck: false(the stricter, recommended setting) cannot compile without enablingskipLibCheck, which then disables.d.tschecking for all dependencies. A correct type declaration here would let consumers keep strict library checks.Environment
@salesforce/core: 9.1.0 (and 8.32.6)pino: 9.14.0typescript: 6.0.3 (also reproduces on 7.0.2)moduleResolution: NodeNext