Goog is not defined

789 views
Skip to first unread message

Rupak Choudhury

unread,
Jun 7, 2022, 7:47:24 AM6/7/22
to blo...@googlegroups.com
Hi team,

I have created one custom field on blockly at version 2.x but now i am updating the blockly version to 8.0.2.

Now getting an error saying 'goog is not defined' on goog.provide('......').

Could you please suggest any fix for this?

Thanks,
Rupak

Neil Fraser

unread,
Jun 7, 2022, 8:03:53 AM6/7/22
to blo...@googlegroups.com
Could you provide details on how Blockly is being loaded?

Are you using blockly_compressed.js, or are you importing the uncompressed files individually?

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CALyaOYpPTFCv6hH8hqRiQKJ2CeCMtWskTS6cNXuqBX%3D407Trfg%40mail.gmail.com.


--

Rupak Choudhury

unread,
Jun 8, 2022, 12:20:38 AM6/8/22
to blo...@googlegroups.com
Hi Neil,

I am using  blockly_compressed.js. I have made seprate bundle and loading it.

Thanks,
Rupak

Neil Fraser

unread,
Jun 8, 2022, 6:49:24 AM6/8/22
to Blockly
So goog is still defined in blockly_compressed.js, but it appears to be defined as a local variable in an immediately executed function.  Thus it appears as though one can't use goog outside of core anymore.

Instead one needs to use 'import' and compile with npm.  Here's an example of a custom field:
Reply all
Reply to author
Forward
0 new messages