Tfjs: Sandbox Fails on version 2.2.0 and 2.3.0

Created on 8 Sep 2020  路  12Comments  路  Source: tensorflow/tfjs

TensorFlow.js version

>= 2.2.0

Browser version

Chrome Version 85.0.4183.83 (Official Build) (64-bit)

Describe the problem or feature request

Upgrade from TFJS from 2.1.0 to 2.3.0 or 2.2.0 keeps getting "Cannot evaluate flag 'DEBUG': no evaluation function found." when tested on codesandbox.com

Code to reproduce the bug / link to feature request

This is a minimal demo:

Take a look at this simple sandbox: https://codesandbox.io/s/angry-upgrade-4l9pu

Now on the left side, update the version to 2.2.0
image

When you refresh the editor, TFJS errors.

image

I'm not finding anything when googling this issue

awaiting response bug

Most helpful comment

Hey all! Yep, this is definitely an issue with CodeSandbox, it seems like our transpiler has made the imports out of order, which causes /core to be loaded after the others. I'll look into a fix now.

All 12 comments

Thanks for the report @GantMan, i think this is probably related to a bug that should be fixed with this pr. We'll get a
new release out as soon as we can.

It's great to see you again Yannick! Glad this was already on your radar.

Hey @GantMan! is this resolved with 2.4.0?

Heya @tafsiri - I just tested and 2.4.0 has the same bug 馃憥

bug

@GantMan are you able to reproduce this outside of codesandbox? I tried to reproduce this here https://github.com/tafsiri/tfjs-parcel-test but didn't get any error (on either 2.3.0 or 2.4.0).

I'm assuming codesanbox is running npm run start (or something similar)?

I can confirm, this ONLY happens when the code is online through codesandbox.

I'm not sure why ONLY 2.2, 2.3, and 2.4 cause this conflict. That's why I filed it here, rather than with the Codesandbox team.

It might not be a bug with TFJS. I'm quite unsure what changed between 2.1 and 2.2

How can we determine/trace what codesandbox does to generate the page that produces that error? The error suggests that the flags.js file in tjfs-core has not been loaded. If there is a bundling step that does tree shaking and it doesn't respect the side_effects property in the package.json of tfjs_core that might cause this error. But we'd need greater insight into the bundling/loading process to see if it's a bug on our end.

I've reached out to codesandbox - I'll see if I can get us some further info.

Hey all! Yep, this is definitely an issue with CodeSandbox, it seems like our transpiler has made the imports out of order, which causes /core to be loaded after the others. I'll look into a fix now.

Just merged it, it should be live within 30 min!

This works with 2.4 and even the latest 2.5! Great work! Thanks so much @CompuIves for helping. Codesandbox is my preferred tool for sharing, demonstrating, and updating TFJS codebases.

I'll close this ticket, as it seems it's 100% working! 馃コ

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

Was this page helpful?
0 / 5 - 0 ratings