Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scratch3] Input hat seems to be broken #8

Open
intrigus opened this issue Sep 22, 2019 · 6 comments
Open

Scratch3] Input hat seems to be broken #8

intrigus opened this issue Sep 22, 2019 · 6 comments

Comments

@intrigus
Copy link
Contributor

Used scratch file:

image

Expected behaviour:

I drag the input hat to the stage.
When I press the green flag the (hypothetical) code after the hat is exectued.

Actual behaviour:

As soon as I begin to drag the hat to the stage an exception is thrown.

Error:

lib.min.js:270125 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Scratch3FtduinoBlocks.parse (lib.min.js:270125)
    at serial.Port.port.onReceive (lib.min.js:270200)
    at lib.min.js:269660
parse @ lib.min.js:270125
port.onReceive @ lib.min.js:270200
(anonymous) @ lib.min.js:269660
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269662
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269685
Promise.then (async)
serial.Port.connect @ lib.min.js:269684
connect @ lib.min.js:270179
(anonymous) @ lib.min.js:270233
Promise.then (async)
autoConnect @ lib.min.js:270226
Scratch3FtduinoBlocks @ lib.min.js:269853
loadExtensionURL @ lib.min.js:265657
handleItemSelect @ lib.min.js:328425
wrapper @ lib.min.js:71256
handleSelect @ lib.min.js:316886
wrapper @ lib.min.js:71256
handleClick @ lib.min.js:329111
wrapper @ lib.min.js:71256
callCallback @ lib.min.js:83398
invokeGuardedCallbackDev @ lib.min.js:83437
invokeGuardedCallback @ lib.min.js:83294
invokeGuardedCallbackAndCatchFirstError @ lib.min.js:83308
executeDispatch @ lib.min.js:83692
executeDispatchesInOrder @ lib.min.js:83711
executeDispatchesAndRelease @ lib.min.js:83812
executeDispatchesAndReleaseTopLevel @ lib.min.js:83823
forEachAccumulated @ lib.min.js:83791
processEventQueue @ lib.min.js:83968
runEventQueueInBatch @ lib.min.js:86463
handleTopLevel @ lib.min.js:86472
handleTopLevelImpl @ lib.min.js:86203
batchedUpdates @ lib.min.js:93938
batchedUpdates @ lib.min.js:85186
dispatchEvent @ lib.min.js:86277

image

@harbaum
Copy link
Owner

harbaum commented Oct 17, 2019

Which version did you use? The "offline" version or the online version available at https://harbaum.github.io/ftduino/webusb/scratch3/ ?

The current online version works for me. If it still fails for you please report which version you use on which OS and which browser you are using.

Edit. Ok, from the screenshot you seem to be using the online version. However, for me the hat works as expected. So please retry with the current version.

@intrigus
Copy link
Contributor Author

It still fails for me. In the console I can still see the exception despite the scratch ui looking normal.
Google Chrome: Version 77.0.3865.120 (Offizieller Build) (64-Bit)
OS: Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux

@harbaum
Copy link
Owner

harbaum commented Oct 18, 2019

Still not reproducible here on Ubuntu 18.04 and Chromium 77.0.3865.90

I open the url in chromium with the ftduino already connected, select the ftDuino extension, drag the hat into the main area ... and it just works ...

@harbaum
Copy link
Owner

harbaum commented Oct 18, 2019

Ah ... i see. I can trigger that problem by clicking the hat. Otherwise it just works as expected. But when clicking it something goes wrong.

@harbaum
Copy link
Owner

harbaum commented Oct 18, 2019

Please try again ... The fact that HATs in scratch don't support promises really doesn't make asynchronous USB io easier to deal with ....

@harbaum
Copy link
Owner

harbaum commented Oct 18, 2019

For reference. This is related to scratchfoundation/scratch-vm#2129 and the fact that HATs don't support async processing which requires a lot of nasty hacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants