In trying to test #233 I discovered that TensorFlow.js is not automatically detecting that it is running in the Node environment when running tests. This seems to be because webpack is building in process/browser.js, which overrides the process global in a way that hides that the environment is Node. This is useful when running libraries that expect to run in browser but breaks libraries that need to know, like TensorFlow. This seems like a Webpack 4 issue and upgrading to Webpack 5 seems to fix the problem but results in new problems.
At this point I have discovered too many yaks and would like someone more familiar with this library to take a look. The end result might be that we need to build Node and non-Node versions of the bundle. I'm not familiar with the solutions in this space.
In trying to test #233 I discovered that TensorFlow.js is not automatically detecting that it is running in the Node environment when running tests. This seems to be because webpack is building in
process/browser.js
, which overrides theprocess
global in a way that hides that the environment is Node. This is useful when running libraries that expect to run in browser but breaks libraries that need to know, like TensorFlow. This seems like a Webpack 4 issue and upgrading to Webpack 5 seems to fix the problem but results in new problems.At this point I have discovered too many yaks and would like someone more familiar with this library to take a look. The end result might be that we need to build Node and non-Node versions of the bundle. I'm not familiar with the solutions in this space.