Discuss Scratch

samq64
Scratcher
1000+ posts

How do I successfully build scratch-blocks?

I've tried building scratch-blocks with Windows, WSL and Raspberry Pi OS, but I wasn't able to successfully build it. Does anyone know how to build scratch-blocks and link it to the GUI? Here is some discussion from the modding Scratch 3 thread after using WSL.

samq64 wrote:

kccuber wrote:

samq64 wrote:

kccuber wrote:

samq64 wrote:

I tried installing scratch-blocks with WSL and it still didn't work.
SUCCESS: blockly_uncompressed_horizontal.js
SUCCESS: blockly_uncompressed_vertical.js
FATAL ERROR
Required namespace "goog.events.EventWrapper" never defined.
??? at line 57:
goog.requireType('goog.events.EventWrapper');
^
I successfully built scratch-blocks with WSL after adding
goog.require('goog.debug.ErrorHandler');
goog.require('goog.events.EventLike');
goog.require('goog.events.EventWrapper');
to /core/blockly.js.
I had the EXACT SAME ERROR. Delete scratch-blocks and reclone from https://github.com/LLK/scratch-blocks.git (Keep the .git at the end)
Now it's broken again…
whut
ok did you remember to npm/yarn link
What I meant was that npm install was successful after I modified blockly.js, but the editor was crashing, so I cloned scratch-blocks again with .git at the end (I'm cloning TurboWarp's repos, not LLK's) and got the same error I posted above. After re-adding the blockly.js changes and running npm start, the code editor crashes with the same error I got yesterday, which is
lazy scratch-blocks: TypeError: goog.isString is not a function

Edit: I fixed that one, but now I'm getting another similar error:
lazy scratch-blocks: TypeError: goog.isFunction is not a function

kccuber wrote:

samq64 wrote:

The errors never end!
Oops! Something went wrong.

We are so sorry, but it looks like TurboWarp has crashed. Please refresh your page to try again.

lazy scratch-blocks: Error: Field "function(a,b){this.size_=new goog.math.Size(0,0);this.class_=b;this.setValue(a)}" must have a fromJson function
Uhh…. Delete the whole thing, try again, using these links for git cloning:
git clone --depth=1 https://github.com/TurboWarp/scratch-gui.git
git clone https://github.com/TurboWarp/scratch-blocks.git
git clone https://github.com/TurboWarp/scratch-vm.git

Last edited by samq64 (Feb. 6, 2022 21:29:35)

Greypath
Scratcher
100+ posts

How do I successfully build scratch-blocks?

goog.require('goog.debug.ErrorHandler');
goog.require('goog.events.EventLike');
goog.require('goog.events.EventWrapper');
goog.require('goog.debug.ErrorHandler');
goog.require('goog.events.EventLike');
goog.require('goog.events.EventWrapper');

Greypath - Good Projects!
|| Indian || Professional Coder || Poet ||

“The way which you thought the least, was the most effective way.”
- Greypath



Variable Complex Project


kccuber
Scratcher
1000+ posts

How do I successfully build scratch-blocks?

Actually, the correct way is to install default-jre on WSL Ubuntu, which fixes this odd bug. Had this issue today and the default-jre fixed it.


Made using Nord Theme & Inkscape
Jon92
Scratcher
2 posts

How do I successfully build scratch-blocks?

hacktronics wrote:

I had build it 2 days back only, for https://ide.codeskool.cc/, and documented my observation at: https://github.com/LLK/scratch-blocks/issues/2734. Hope that would be useful for anyone.
Thanks! It turns out I was using the wrong version of the closure-library.

kccuber wrote:

Actually, the correct way is to install default-jre on WSL Ubuntu, which fixes this odd bug. Had this issue today and the default-jre fixed it.
Thank you! That fixed everything! (By the way, I'm not using WSL anymore because I switched to using a raspberry Pi)

Edit: Oops, I didn't realize I was logged in to my sibling's account.

Last edited by Jon92 (Feb. 11, 2022 14:36:29)

Powered by DjangoBB