tfjs: Breaking Change v3.8.0 => v3.9.0
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows
- TensorFlow.js installed from (npm or script link): npm
- TensorFlow.js version (use command below): 3.9.0
Describe the current behavior
Upgraded from 3.8.0 to 3.9.0, and typescript throws an error:
Error: node_modules/@tensorflow/tfjs-core/dist/hash_util.d.ts:2:49 - error TS2304: Cannot find name ‘Long’.
Using typescript
4.3.5.
Perhaps missing import Long from 'long';
in
Describe the expected behavior
No breaking change
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 16 (6 by maintainers)
I am also having the same issue on a fresh Angular 12 install… Version is 3.11.0
When I manually add
/// <reference types="long" />
to thehash_util.d.ts
it works as expected.Before
After
v3.12.0
Added
@types/long
to mycompilerOptions.types
worked.Step 1. npm I -D @types/long Step 2. go to tsconfig.app.json Step 3. add “types”: [“@types/long”]
----->tsconfig.app.json this file will looks like
{ “extends”: “./tsconfig.json”, “compilerOptions”: { “outDir”: “./out-tsc/app”,
“types”: [“@types/long”]
}, “files”: [ “src/main.ts”, “src/polyfills.ts” ], “include”: [ “src/**/*.d.ts” ] } -------> it worked for me, hope will work for you as well.