We're using a custom build of the JS API generated with the Web Optimizer (jso.arcgis.com). It's been working OK (though I had to add some missing modules manually that the dependencies didn't pick up - could see those in the browser debugger when it tried to retrieve missing module files).
Now I'm adding in a drawing toolbar. The toolbar initializes, but when I call the toolbar.activate method, I get an error:
Cannot read property 'setImmediateClick' of undefined
If I step into the custom dojo.js code, I see the error is occurring in this statement of the draw tool:
Here the "c" is a reference to the map object.
EDIT: I created a custom build for the above-mentioned graphics sample. I started from the option to manually specify modules, and chose the compact build as the starting point. I added the modules listed in the sample. I set up the sample to use this custom build. On a side note, when I first ran with this custom build, I got errors. I had to add two more modules to get it to run at all: dojo/gfx/svg and esri/dijit/Attribution.
With this updated custom build, the graphics sample ran fine, and I could draw graphics. I stepped into the code and can see that the map.navigationManager is populated and works. I compared it to my application's custom build, and added a couple of modules so that my app used all the ones in the sample's build. However, that custom build still fails - no map.navigationManager. More mystifying than before.