TypeError: Cannot read property 'length' of undefined RRS feed

  • Question

  • There was a thread addressing this issue in the Preview forum but I believe it is locked now that we've moved out of the preview stage and into this forum.  I tried what was suggested there but it doesn't seem to work.

    I've created a custom Lightswitch Data Source Extension, which in and of itself was incredibly difficult to do, given that the only documentation or guide I could find was this walkthrough here.  While the walkthrough deals with an XML data source, I'm actually dealing with an OData feed from a semantic database, and using the custom data source as a middle layer to take individual facts and construct more meaningful objects that are then put into nice tables for use in Lightswitch.  My extension works beautifully in regular Lightswitch, but in Lightswitch HTML the dialog error "TypeError: Cannot read property 'length' of undefined" pops up right away with the following errors in the Javascript developer console.

    The other post suggested unchecking all extensions, which obviously doesn't work because I need my custom DataSourceExtension in order to add it as a WCF RIA  data source.  I have tried unchecking the default Lightswitch Extensions and just leaving my custom Extension as well.  At this point I've hit a brick wall and have basically concluded that some files that should be automatically generated have not been.

    Here is a screenshot of my Lightswitch Extensions tab for the test project.

    Any help is much appreciated!

    Thursday, April 4, 2013 8:09 PM


All replies

  • Hi.

    I had the same problem and thats why I now use preview 2 instead, not the ctp4.

    This is a known bug and I'm sorry to say but I don´t think you will get past the problem.

    I hope the next update will fix the problem otherwise the whole LS will be worthless.

    But I can be wrong here. Maby MS can help you out.

    Good luck!


    Sven Elm

    Thursday, April 4, 2013 8:56 PM
  • Hi Steve,

    This should be fixed in the Update 2 release that was released this morning:

    If you've already upgraded your CTP4 project and are still seeing the issue, please let us know.


    Steve Hoag Microsoft aka the Lights Witch (IEnumerable of Newt)

    • Marked as answer by Steve Kehoe Wednesday, May 1, 2013 3:24 PM
    Thursday, April 4, 2013 9:51 PM