I was just about ready to tear my own head off when I’ve finished unit testing my Service and Model classes and had damn near close to 100% code coverage, and ran into some really fiddly issues with dojo. I’m doing this retrospectively, so off the top of my head these are the two issues that had me scratching my head due to their obscurity.
First issue: got a ”dojo.data.ItemFileWriteStore” is not a constructor” message.
I use ItemFileWriteStore as my data store for a combo box intended to list fields in a search. Users could then have the ability to filter through the list by typing a letter in the combobox and auto complete suggestions will be displayed in a list below ala a select list. Problem is when I was running it, I get this error message.
I decided to verify that nothing’s wrong with the way I built the dojo JS library. Then headed to google. First few results were garbage, then came an exact match. It was one of two cases:
- dojo.require() is missing
- The constructor statement occurs before dojo has completed loading.

