Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: weinre
    • Labels:
      None

      Description

      Weinre does not work correctly on Android 2.3.3 :
      After only one correct log, i keep getting this error :

      01-16 12:33:56.196: E/Web Console(465): TypeError: Result of expression 'contentType' [null] is not an object. at http://192.168.22.27:8080/target/target-script-min.js#anonymous:2772

      and does not get any more log (only errors), app works & i get logs in eclipse logcat without weinre correctly.

        Activity

        Hide
        pmuellr Patrick Mueller added a comment -

        Thanks for the bug report.

        This seems to be a problem with target/NetworkRequest.coffee in the getResponse() function. It's getting a null back as the Content-Type header. This shouldn't be a big deal to fix, though there may be a handful of additional things I need to do/check.

        I'm wondering how I can create an easy test case for this, so I can at least try the fix and see if it works.

        In the meantime, I wonder if you have the ability to set the Content-Type header for your XHRs to work around the bug ...

        Show
        pmuellr Patrick Mueller added a comment - Thanks for the bug report. This seems to be a problem with target/NetworkRequest.coffee in the getResponse() function. It's getting a null back as the Content-Type header. This shouldn't be a big deal to fix, though there may be a handful of additional things I need to do/check. I'm wondering how I can create an easy test case for this, so I can at least try the fix and see if it works. In the meantime, I wonder if you have the ability to set the Content-Type header for your XHRs to work around the bug ...
        Hide
        mgcrea Olivier Louvignes added a comment -

        I'm using Sencha Touch 2.0 pr3 :
        http://www.sencha.com/blog/sencha-touch-2-developer-preview/

        You could try this code to replicate this.
        https://gist.github.com/1620901

        There may be a way to override ContentType in Sencha Touch, i'm looking into this.

        Show
        mgcrea Olivier Louvignes added a comment - I'm using Sencha Touch 2.0 pr3 : http://www.sencha.com/blog/sencha-touch-2-developer-preview/ You could try this code to replicate this. https://gist.github.com/1620901 There may be a way to override ContentType in Sencha Touch, i'm looking into this.
        Hide
        cdelguercio Chris Del Guercio added a comment -

        I get this error when attempting to use weinre 1.6.1 with PhoneGap. Has this issue been resolved?

        Show
        cdelguercio Chris Del Guercio added a comment - I get this error when attempting to use weinre 1.6.1 with PhoneGap. Has this issue been resolved?
        Hide
        pmuellr Patrick Mueller added a comment -

        No, doesn't look like it's fixed yet.

        The problem is here: NetworkRequest.coffee:123.

        In addition, I just noticed there's a problem here: NetworkRequest.coffee:131 - we should be pulling the Content-Length header as well, and setting it the expectedContentLength property.

        In the case of Content-Type, I think if there isn't one provided, we should default to something - and I'm thinking application/octet-stream or text/plain, leaning towards the first.

        In the case of Content-Length, I think the first thing to try is to not set the expectedContentLength property at all, but we'll need to make sure the client can survive without it. Given that it's currently being set to the Content-Type, the client can clearly tolerate a non-numeric value.

        Show
        pmuellr Patrick Mueller added a comment - No, doesn't look like it's fixed yet. The problem is here: NetworkRequest.coffee:123 . In addition, I just noticed there's a problem here: NetworkRequest.coffee:131 - we should be pulling the Content-Length header as well, and setting it the expectedContentLength property. In the case of Content-Type, I think if there isn't one provided, we should default to something - and I'm thinking application/octet-stream or text/plain , leaning towards the first. In the case of Content-Length, I think the first thing to try is to not set the expectedContentLength property at all, but we'll need to make sure the client can survive without it. Given that it's currently being set to the Content-Type, the client can clearly tolerate a non-numeric value.
        Show
        pmuellr Patrick Mueller added a comment - Committed fix to master: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-weinre.git;a=commit;h=e455568d9fa924f2833a04330a3c2ea047b5a772
        Hide
        pmuellr Patrick Mueller added a comment -

        A build with this fix is available at GitHub:

        https://github.com/pmuellr/incubator-cordova-weinre/downloads

        in the file:

        https://github.com/downloads/pmuellr/incubator-cordova-weinre/weinre-node-1.7.0-pre-2012-02-27--22-31-18.tar.gz

        You can install this directly with npm, with the following command:

        sudo npm -g install {tar.gz url above}
        
        Show
        pmuellr Patrick Mueller added a comment - A build with this fix is available at GitHub: https://github.com/pmuellr/incubator-cordova-weinre/downloads in the file: https://github.com/downloads/pmuellr/incubator-cordova-weinre/weinre-node-1.7.0-pre-2012-02-27--22-31-18.tar.gz You can install this directly with npm, with the following command: sudo npm -g install {tar.gz url above}
        Hide
        pmuellr Patrick Mueller added a comment -

        if you didn't get any notifications on this bug change, please check again; there's a fix in and a build available

        Show
        pmuellr Patrick Mueller added a comment - if you didn't get any notifications on this bug change, please check again; there's a fix in and a build available
        Hide
        jessecai Jesse Cai added a comment - - edited

        Hi Patrick Mueller,

        Can you have a binary version to download? I'm running mac os, can not finish the npm install.

        udo npm -g install pmuellr-incubator-cordova-weinre-1.6.1-13-g344f764.tar.gz
        Password:
        npm ERR! couldn't unpack /tmp/npm-1332409276750/1332409276750-0.444108875002712/tmp.tgz to /tmp/npm-1332409276750/1332409276750-0.444108875002712/contents
        npm ERR! 404 'pmuellr-incubator-cordova-weinre-1.6.1-13-g344f764.tar.gz' is not in the npm registry.
        npm ERR! 404 You should bug the author to publish it.
        npm ERR! 404 Note that you can also install from a tarball or folder.
        npm ERR!
        npm ERR! System Darwin 11.3.0
        npm ERR! command "node" "/usr/local/bin/npm" "-g" "install" "pmuellr-incubator-cordova-weinre-1.6.1-13-g344f764.tar.gz"
        npm ERR! cwd /Users/jesse/Downloads
        npm ERR! node -v v0.4.8
        npm ERR! npm -v 1.0.27
        npm ERR!
        npm ERR! Additional logging details can be found in:
        npm ERR! /Users/jesse/Downloads/npm-debug.log
        npm not ok

        Show
        jessecai Jesse Cai added a comment - - edited Hi Patrick Mueller, Can you have a binary version to download? I'm running mac os, can not finish the npm install. udo npm -g install pmuellr-incubator-cordova-weinre-1.6.1-13-g344f764.tar.gz Password: npm ERR! couldn't unpack /tmp/npm-1332409276750/1332409276750-0.444108875002712/tmp.tgz to /tmp/npm-1332409276750/1332409276750-0.444108875002712/contents npm ERR! 404 'pmuellr-incubator-cordova-weinre-1.6.1-13-g344f764.tar.gz' is not in the npm registry. npm ERR! 404 You should bug the author to publish it. npm ERR! 404 Note that you can also install from a tarball or folder. npm ERR! npm ERR! System Darwin 11.3.0 npm ERR! command "node" "/usr/local/bin/npm" "-g" "install" "pmuellr-incubator-cordova-weinre-1.6.1-13-g344f764.tar.gz" npm ERR! cwd /Users/jesse/Downloads npm ERR! node -v v0.4.8 npm ERR! npm -v 1.0.27 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/jesse/Downloads/npm-debug.log npm not ok
        Show
        pmuellr Patrick Mueller added a comment - https://github.com/pmuellr/incubator-cordova-weinre/downloads

          People

          • Assignee:
            pmuellr Patrick Mueller
            Reporter:
            mgcrea Olivier Louvignes
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development