Skip to content

bug: exported type declaration incompatible since 9.4.0 #1350

@jkowalleck

Description

@jkowalleck

while the JavaScript works as expected,
downstream users of lately-deprecated functions (the ones that were moved to "contrib" area) might find their typescript linters/compilers complaining about some re-exports being not a type, but a const.

example: https://github.com/CycloneDX/cyclonedx-esbuild/actions/runs/19877209546/job/56967254145#step:5:21

error TS2749: 'CDX.Builders.FromNodePackageJson.ComponentBuilder' refers to a value, but is being used as a type here. Did you mean 'typeof CDX.Builders.FromNodePackageJson.ComponentBuilder'?

this happens only if the respective symbol is used as a type, for any other access there is no issue.

const extRefFac= new CDX.Contrib.FromNodePackageJson.Factories.ExternalReferenceFactory()
const a = new CDX.Builders.FromNodePackageJson.ToolBuilder(extRefFac) // no issue
const b: CDX.Builders.FromNodePackageJson.ToolBuilder = a // issue
// error TS2749: 'CDX.Builders.FromNodePackageJson.ToolBuilder' refers to a value, but is being used as a type here. Did you mean 'typeof CDX.Builders.FromNodePackageJson.ToolBuilder'?
// 93 const b: CDX.Builders.FromNodePackageJson.ToolBuilder = a
//             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions