Open FlyingTurkman opened 7 months ago
Hi, @FlyingTurkman
I apologize for the delayed response and thank you for bringing this issue to our attention, as far I know that error typically arises due to a Webpack configuration issue during the build process so may be Webpack's tree-shaking functionality might be causing problems. Try disabling it for the TensorFlow.js packages If you're comfortable with a potential increase in bundle size and want a quick solution, disabling tree-shaking globally might solve this issue and please refer official documentation of Generating size-optimized browser bundles with TensorFlow.js, if possible please give it try with Rollup
might have better compatibility with TensorFlow.js:
// webpack.config.js
module.exports = {
// ... other configurations
optimization: {
minimize: true,
sideEffects: false, // Disable tree-shaking for TensorFlow.js packages
},
};
If I have missed something here please let me know. Thank you for your cooperation and patience.
Hi, @FlyingTurkman
I apologize for the delayed response and thank you for bringing this issue to our attention, as far I know that error typically arises due to a Webpack configuration issue during the build process so may be Webpack's tree-shaking functionality might be causing problems. Try disabling it for the TensorFlow.js packages If you're comfortable with a potential increase in bundle size and want a quick solution, disabling tree-shaking globally might solve this issue and please refer official documentation of Generating size-optimized browser bundles with TensorFlow.js, if possible please give it try with
Rollup
might have better compatibility with TensorFlow.js:// webpack.config.js module.exports = { // ... other configurations optimization: { minimize: true, sideEffects: false, // Disable tree-shaking for TensorFlow.js packages }, };
If I have missed something here please let me know. Thank you for your cooperation and patience.
Thank you for response but not working.
I am trying to build a next js app includes tensorflow.js but an error has occured.
Creating an optimized production build ... Failed to compile.
./node_modules/@tensorflow/tfjs-backend-webgl/dist/register_all_kernels.js + 256 modules Cannot get final name for export 'transposeImplCPU' of ./node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Transpose_impl.js
Tensorflow versions: "@tensorflow/tfjs": "^4.17.0", "@tensorflow/tfjs-core": "^4.17.0",
Code
Also when I tried deploy to vercel same error occured.