The conditional require('canvas') statement on line 388 causes the build to break when using Browserify or the RequireJS optimizer.
This happens because the build tools look through the source and find all calls to require() and attempt to eagerly include them, since whether or not the code would actually execute is cannot be known at built time.
This means Browserify / RequireJS attempt to resolve the canvas module, which isn't found (or needed, as we are targeting the browser).
Removal of the require() call fixes this issue.
What this dude said.
Remove require from main layout file.
This also includes a backwards-incompatible change to module naming when
used with Node.js: instead of require("d3-cloud").cloud, you should now
use require("d3-cloud") directly.