Search code examples
javascriptblocklygoogle-blockly

Missing provider for goog.date when recompiling the build.py file - google blockly


We have added field_date in blockly.js file and trying to recompile the build.py file but when running, it is throwing an error of missing provider goog.date . How can we solve this issue we are using latest blockly version.


Solution

  • Google is slowly removing the closure library dependencies from blockly. So closure library is not added by default anymore.

    The field_date depends on closure library. So it needs to be added manually into the library and the library has to be rebuilt. The process to achieve this is mentioned as a warning text in the blockly FieldDate documentation -

    Warning: Due to its limited use and large footprint, FieldDate is not compiled into Blockly by default. To use it you will need to require it and rebuild. Add goog.require('Blockly.FieldDate') to your project, or uncomment it inside blockly.js to enable it. FieldDate also depends on the Closure Library which is no longer compiled into Blockly by default. You will need to add google-closure-library to your package.json and rebuild with the --closure-library flag: gulp build --closure-library.