Skip to content

Missing Complex32 import in @stdlib/types/ndarray causes TS2552 in v0.5.1 #15916

Open

Description

@Loic-Vanden-Bossche

Description

After updating @stdlib/stats from ^0.3.3 to ^0.4.1, TypeScript/Angular compilation fails because @stdlib/types@0.5.1 references Complex32 inside the @stdlib/types/ndarray module without importing it.

Error

TS2552: Cannot find name 'Complex32'. Did you mean 'Complex128'?

../../node_modules/@stdlib/types/index.d.ts:4462:33:
4462 │     get( ...args: Array<number> ): Complex32;

Dependency resolution

@stdlib/stats@0.4.1 resolves to:

@stdlib/types@0.5.1

All other @stdlib/* packages in the dependency tree also resolve to @stdlib/types@0.5.1, so this does not appear to be a multiple-version conflict.

Root cause

In @stdlib/types@0.5.1, the @stdlib/types/ndarray module imports:

import { ComplexLike, Complex128, Complex64 } from '@stdlib/types/complex';

but later uses:

get( ...args: Array<number> ): Complex32;

So Complex32 is referenced without being imported in that module.

The current main branch of stdlib-js/types already appears to contain the fix:

import { ComplexLike, Complex128, Complex64, Complex32 } from '@stdlib/types/complex';

The change is visible in this commit:

stdlib-js/types@7c05bfc

Environment

  • @stdlib/stats: 0.4.1
  • @stdlib/types: 0.5.1
  • Package manager: Yarn 4
  • Compiler: Angular compiler / TypeScript

Expected behavior

@stdlib/types@0.5.1 should compile without type declaration errors.

Workaround

Downgrading @stdlib/stats back to 0.3.3 avoids pulling in the affected type declarations.

Would it be possible to publish a new @stdlib/types release containing the existing Complex32 import fix?

Activity

  1. stdlib-bot commented on Oct 5, 2026

    @stdlib-bot
    Contributor

    👋 Hi there! 👋

    And thank you for opening your first issue! We will get back to you shortly. 🏃 💨

    If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members.

  2. kgryte commented on Oct 12, 2026

    @kgryte
    Member

    @Planeshifter Mind taking a look at this?

  3. added
    BugSomething isn't working.
    TypeScriptIssue involves or relates to TypeScript.
    priority: HighHigh priority concern or feature request.
    on Oct 12, 2026
  4. 0PrashantYadav0 commented on Oct 15, 2026

    @0PrashantYadav0
    Member

    I can confirm this. It's broader than the one error in the report. Compiling @stdlib/types@0.5.1 with TS 5.9 (--strict, lib: es2022, no skipLibCheck) gives three errors in the @stdlib/types/ndarray module:

    • TS2552: Cannot find name 'Complex32' (L4462)
    • TS2552: Cannot find name 'Complex32Array' (L4445)
    • TS2304: Cannot find name 'Float16Array' (L3291, only when lib doesn't include esnext)

    complex32ndarray was added in b9502d5 (2026-04-23) without updating that module's imports, and that state shipped in 0.5.0/0.5.1. All three are already fixed on develop by b77ce8d (2026-08-12), and develop's index.d.ts compiles cleanly under the same settings. So no code change is needed, just a new @stdlib/types release.

    Until then, "skipLibCheck": true in tsconfig.json avoids the errors. Yarn 4's yarn patch @stdlib/types also works if you'd rather keep lib checking on.

    @Planeshifter @kgryte Could we publish a 0.5.2 from current develop? Also, would a CI step that runs tsc on @stdlib/types/index.d.ts without skipLibCheck be welcome? It would have caught this, and I'm happy to open a PR for it.

  5. 0PrashantYadav0 commented on Oct 15, 2026

    @0PrashantYadav0
    Member

    Should I move forward with PR or need to collect more information on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething isn't working.TypeScriptIssue involves or relates to TypeScript.priority: HighHigh priority concern or feature request.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions