locked
My app fails by the requirement 3.2

    Question

  • Hi!
    When I try to release an update to my app, it fails by the requirement 3.2.


    Notes from Testers:

    Unfortunately, when our reviewers tried to launch your app failed to launch every time. Our reviewers were unable to complete a review. If we were able to capture a crash report, we have provided it to you. Please see: http://go.microsoft.com/fwlink/?LinkId=279806 for information on how to work with the crash reports.


    I also got an errorfile which says:

    ErrorDescription=Unable to get property 'style' of undefined or null reference

    ErrorType=5

    ErrorTypeText=Type error

    ErrorNumber=800A138F

    SourceFile=ms-appx://53658camerial.theperiodictable-chemistry/default.html

    Line=30

    Character=14

    DocumentURL=/default.html

    OSProduct=Windows 8 Pro

    OSVersion=6.2.9200.0

    OSServicePack=0

    UserAgentString=Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; MSAppHost/1.0)

    StackTraceAvailability=2

    StackTrace=ms-appx://53658camerial.theperiodictable-chemistry/default.html:30:14           Global code

    ms-appx://microsoft.winjs.1.0/js/base.js:4676:14           addScript

    ms-appx://microsoft.winjs.1.0/js/base.js:4772:71           Anonymous function

    ms-appx://microsoft.winjs.1.0/js/base.js:4638:14           forEach

    ms-appx://microsoft.winjs.1.0/js/base.js:4772:10           processDocument

    ms-appx://microsoft.winjs.1.0/js/base.js:4724:22           Anonymous function

    ms-appx://microsoft.winjs.1.0/js/base.js:1404:22           notifySuccess

    ms-appx://microsoft.winjs.1.0/js/base.js:1091:22           enter

    ms-appx://microsoft.winjs.1.0/js/base.js:1307:18           _run

    ms-appx://microsoft.winjs.1.0/js/base.js:1275:14           _completed

    StackTraceHash=1f3c1f06ede07d7e0e14de71ac2e7bc0

    IsTerminal=True


    I localized the line 30 in default.html which is:

    h1 {
    position:absolute;
    top:30px;
    color:#214f8f;
    }


    How can this be the problem? When I launch my app on my computer it runs perfectly…

    Thursday, May 16, 2013 6:00 PM

Answers

  • Thanks. The problem is that WinJS.UI.processAll has to be called after DOMContentLoaded. As you had it, it's being called before there's anything in the DOM to work with--this is definitely a timing issue, as on some hardware it's possible that the DOMContentLoaded is queued up in time for this script to catch it.

    The right place for the call is within the WinJS.Application.onactivated event. Create a new project from the Blank App template and look in default.js for an example if you need it. That way you'll be sure to call it when the DOM is ready and no sooner.

    Monday, May 20, 2013 2:46 AM

All replies

  • I don’t think the line number is indicative, because your call stack clearly indicates that you’re in a function called processDocument, inside which is a foreach loop, whose anonymous callback is calling addScript.

    The specific error also says that you’re doing an object.style = assignment within addScript and object is null or otherwise invalid.

    To identify the problem, can you share the processDocument and addScript functions? I also need to know where processDocument is being called from, e.g. please share the code around where that call is made.

    My guess is that processDocument is called around WinJS.UI.processAll and the page in question contains WinJS controls (or is a page control)? If so, it’s possible that the code structure isn’t set up to wait until WinJS.UI.processAll is complete, meaning that some elements on the page might not be instantiated when you get to processDocument. If this isn’t showing up on your own machine, it could be that the async processAll is completing before you get to your processDocument, thus hiding the error that shows up on slower test machines used by the Store certification folks. In fact, if you have a slower device to test on (like an ARM tablet), you might be able to repro the crash.

    Looking forward to your code in any case

    Kraig

    Author, Programming Windows 8 Apps with HTML, CSS, and JavaScript, a free ebook from Microsoft Press

    Thursday, May 16, 2013 7:46 PM
  • Hi Kraig! Thanks for your reply!

    I do use the navigation layout, so it is probably as you said. Unfortunately, I don't have a tablet to test on…

    I’m really new at programming windows 8 applications, and I didn’t understood what you meant with I’m in a function called processDocument, whose anonymous callback is calling addScript, because I have never made a function called processDocument!

    Therefore, I really don't know what code I should send you…

    But while I searched for the error, I found this in my home.html:

    <script type="text/javascript">WinJS.UI.processAll();</script>
    
    <script type=”text/javascript”>
    
    //My code was here  
    
    </script>
    
    Could that be the error?

    Thanks for the help!

    Sunday, May 19, 2013 10:10 AM
  • Thanks. The problem is that WinJS.UI.processAll has to be called after DOMContentLoaded. As you had it, it's being called before there's anything in the DOM to work with--this is definitely a timing issue, as on some hardware it's possible that the DOMContentLoaded is queued up in time for this script to catch it.

    The right place for the call is within the WinJS.Application.onactivated event. Create a new project from the Blank App template and look in default.js for an example if you need it. That way you'll be sure to call it when the DOM is ready and no sooner.

    Monday, May 20, 2013 2:46 AM