project reports `cant find package` for a package that is not referenced at all
See original GitHub issueproject reports cant find package
for a package that is not referenced at all
simple reproduction: https://stackblitz.com/edit/typescript-blff19
project as-is works fine, but uncommenting two lines that import and access @tensorflow/tfjs-backend-cpu
results in build error:
Can’t find package:@tensorflow/tfjs-node
but @tensorflow/tfjs-backend-cpu
does not reference @tensorflow/tfjs-node
anywhere
(and yes, @tensorflow/tfjs-node
cannot be installed since its a nodejs module while this is a pure browser project)
the only mention of tfjs-node
inside tfjs-backend-cpu
module anywhere is inside string block:
backend_util.warn('\n============================\n' +
'Hi there 👋. Looks like you are running TensorFlow.js in ' +
'Node.js. To speed things up dramatically, install our node ' +
'backend, which binds to TensorFlow C++, by running ' +
'npm i @tensorflow/tfjs-node, ' +
'or npm i @tensorflow/tfjs-node-gpu if you have CUDA. ' +
'Then call require(\'@tensorflow/tfjs-node\'); (-gpu ' +
'suffix for CUDA) at the start of your program. ' +
'Visit https://github.com/tensorflow/tfjs-node for more details.' +
'\n============================');
is it possible that stackblitz parser misbehaves and does not consider this a string and reports a dependency purely because of this?
also note that using other libraries such as @tensorflow/tfjs-backend-webgl
that have a hard dependency on @tensorflow/tfjs-backend-cpu
do not present an issue and are working just fine
and according to 3rd party user reports, all this used to work until january when some changes went live on stackblitz (according to some unconfirmed notices in old issues, thats when new module parser when live)?
note: this issue is also being tracked by @tensorflow team as a P0 issue - see https://github.com/tensorflow/tfjs/issues/6315
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top GitHub Comments
@vladmandic This issue should be resolved now. Apologies for the radio silence, my PC’s SSD crashed last week! Let me know if you have any issues.
in case you need to understand tensorflow module internal dependencies:
@tensorflow/tfjs-core
core module itself without any platform dependent code (there are few others like that, -data, -layers, -converter)@tensorflow/tfjs-backend-cpu
math ops implemented in js, basically a fallback when optimized implementation is not present; without dependencies on platform-specific implementations (thus the issue here - it does not reference or need tfjs-node)@tensorflow/tfjs-node
core + cpu + bindings to tensorflow.so so it runs optimized for nodejs@tensorflow/tfjs-backend-webgl
core + cpu + optimized math in webgl for browser environments@tensorflow/tfjs
- bundle of core + data + layers + converter + cpu + webgl