question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tensorflow NPM Packages are shipping TypeScript sources instead of just the distrubtion files [URGENT]

See original GitHub issue

This is in my package.json

    "@tensorflow/tfjs": "^2.0.1",

I’m getting this error:

/path/to/project/node_modules/@tensorflow/tfjs-core/src/environment.ts
TypeScript error in /path/to/project/node_modules/@tensorflow/tfjs-core/src/environment.ts(45,3):
Property 'platformName' has no initializer and is not definitely assigned in the constructor.  TS2564

    43 |   private urlFlags: Flags = {};
    44 | 
  > 45 |   platformName: string;
       |   ^
    46 |   platform: Platform;
    47 | 
    48 |   // tslint:disable-next-line: no-any

I also tried "skipLibCheck": true in tsconfig.json but that didn’t work either.

In the case of tfjs, there are actual .ts files (e.g. node_modules/@tensorflow/tfjs-core/src/environment.ts) which cause the failure.

Generally npm modules should ship compiled files and their public APIs, so anything happening internally (in js files) should not be reported.

Related https://www.reddit.com/r/typescript/comments/hjgd30/skiplibcheck_but_for_ts_files/

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tafsiricommented, Jul 24, 2020

Found the bug, it was an errant import path in our source. Should be resolved in the next release goes out.

0reactions
google-ml-butler[bot]commented, Jul 27, 2020

Are you satisfied with the resolution of your issue? Yes No

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use tensorflow js (tfjs) from typescript? - Stack Overflow
But it doesn't exist. On tensorflow js github repository I can see that it is developed using Typescript, but it seems they did...
Read more >
@tensorflow/tfjs-node - npm
This repository provides native TensorFlow execution in backend JavaScript applications under the Node.js runtime, accelerated by the TensorFlow ...
Read more >
Setup | TensorFlow.js
Node.js Setup​​ You can use either the npm cli tool or yarn to install TensorFlow. js. Option 1: Install TensorFlow. js with native...
Read more >
Creating a TS-written NPM package for use in Node-JS or ...
includes . include: Ensure only the Typescript in src is compiled & ignore all other source files (like the tests). Since you cannot ......
Read more >
Organize multiple functions | Cloud Functions for Firebase
Organize functions in codebases. Managing multiple repositories; Managing multiple source packages (monorepo). Write functions in multiple files ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found