Skip to content

qcobjects npm package ships broken TypeScript type declarations (TS2305 on every named export) #119

Description

@jeanmachuca

Summary

The npm-published qcobjects@2.5.142 package ships incomplete/broken TypeScript type declarations. A project importing the framework (import { Package, Controller, Component, New, ... } from "qcobjects") fails tsc with TS2305: Module '"qcobjects"' has no exported member '...' for essentially every named export, so any TypeScript build of the official qcobjectsnewapp template is blocked.

Environment

  • qcobjects@2.5.142 (latest) via npm
  • Node v24.18.1, npm 11.12.1, TypeScript 5.7.2
  • moduleResolution: nodenext (per the official qcobjects-tsconfig base)

Repro

Any TS file that does a named import from the package:

import { Package, Controller, Component, New, ClassFactory, logger } from "qcobjects";

Run:

npx tsc --noEmit --module nodenext --moduleResolution nodenext --target es2021 --lib es2021,dom --esModuleInterop src/app.ts

Result:

src/app.ts(2,10): error TS2305: Module '"qcobjects"' has no exported member 'Package'.
src/app.ts(2,19): error TS2305: Module '"qcobjects"' has no exported member 'Controller'.
src/app.ts(2,31): error TS2305: Module '"qcobjects"' has no exported member 'Component'.
src/app.ts(2,42): error TS2305: Module '"qcobjects"' has no exported member 'New'.
src/app.ts(2,47): error TS2305: Module '"qcobjects"' has no exported member 'ClassFactory'.
src/app.ts(2,61): error TS2305: Module '"qcobjects"' has no exported member 'logger'.

Root cause

--traceResolution shows the package resolves correctly to node_modules/qcobjects/public/types/index.d.ts. However, that single rolled-up declaration file imports/re-exports from bare, unqualified module specifiers that do not exist in the package:

  • export { Package } from "Package"
  • export { New } from "New"
  • export { ClassFactory } from "ClassFactory"
  • export { Controller } from "Controller"
  • export { logger } from "Logger"
  • import ... from "ObjectName", from "getType", from "Export", from "is_raw_class", from "platform", ...

The package ships only one type file:

node_modules/qcobjects/public/types/index.d.ts

There are no Package.d.ts, ObjectName.d.ts, etc. anywhere under the package (verified via find node_modules/qcobjects -name "*.d.ts"). Because these internal specifiers cannot be resolved, every re-exported symbol is dropped, producing the TS2305 errors.

Expected behavior

import { Package, Controller, Component, New, ... } from "qcobjects" should type-check and resolve to the exported framework API, so the official qcobjectsnewapp template's npm run build / npm start (which run tsc via build:ts) can complete.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions