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.

project reports `cant find package` for a package that is not referenced at all

See original GitHub issue

project 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:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
markwhitfeldcommented, May 10, 2022

@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.

1reaction
vladmandiccommented, Apr 27, 2022

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuget Packages are there but missing References
So use the "Update-Package -reinstall" command to force reinstall the package references and content files into project. Share.
Read more >
Nuget package changes not reflected in project References list
NET framework project. Expand the project's References list in the Solution Explorer. Right click on “References” and choose to manage Nuget packages. In...
Read more >
Migrating from packages.config to PackageReference formats
Open the Package Manager UI - Right-click on References and select Manage NuGet Packages... · Open the Package Manager Console - From Tools...
Read more >
Package restore in VS reports "Failed to resolve all project ...
Although all projects are loaded in this solution, I'm getting errors about being unable to resolve project references. This works fine from the ......
Read more >
Report Deletion of Cross Package References - Sparx Systems
When 'Package B' is exported from 'Project X', its XMI file will not contain the cross-package reference 'Y depends on B', as that...
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