Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tomas-javurek opened this issue Feb 20, 2024 · 0 comments
Labels

Comments

@tomas-javurek
Copy link

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant