Skip to content

Type 'InputType' is not assignable to type 'Partial<INumberHash>'... and many others #927

Open
@tomas-javurek

Description

@tomas-javurek

What is wrong?

With Angular 17 during the compilation errors like
Error: node_modules/brain.js/dist/src/neural-network-gpu.d.ts:23:84 - error TS2344: Type 'InputType' does not satisfy the constraint 'INeuralNetworkData'. Type 'InputType' is not assignable to type 'Partial<INumberHash>'. and many others are in the bash.
IDE (VS Code) shows a lot errors inside the *.ts files. Eg.: neural-network-gpu.d.ts Property 'outputs' in type 'NeuralNetworkGPU<InputType, OutputType>' is not assignable to the same property in base type 'NeuralNetwork<InputType, OutputType>'. Type 'KernelOutput[]' is not assignable to type 'Float32Array[]'. Type 'KernelOutput' is not assignable to type 'Float32Array'. Type 'number' is not assignable to type 'Float32Array'.

Where does it happen?

Mac OS X Ventura
Typescript 5.3.3
Angular 17.2.1
node 18.17.0
brain.js 2.0.0-beta.23

How do we replicate the issue?

  • install Angular npm install -g @angular/cli
  • create new Angular project ng new brain-test
  • install brain.js npm i --save brain.js
  • import brain.js to eg. app.component.ts import { NeuralNetwork } from 'brain.js'
  • run angular app ng serve

Expected behavior (i.e. solution)

Should works ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions