GWT module may need to be (re)compiled REDUX

前端 未结 8 1662
日久生厌
日久生厌 2020-11-27 03:30

When running in compiled mode I get this dreaded GWT Module \'mymodule\' may need to be (re)compiled dialog message.

I\'ve compiled a list of the things that others

8条回答
  •  死守一世寂寞
    2020-11-27 04:12

    I found the same issue in DevMode if there was a static link to another page in the application (i.e. myModule2.html). Because it lacked the ?gwt.codesvr=127.0.0.1:9997 string, it was interpreted as a static (already compiled) GWT app, which it was not, throwing the error code you mentioned.

    enter image description here

    Of course the solution is not to use hardcoded literal links, but let GWT make them for you. Hope that helps someone.

    UPDATE:

    This is the code that throws this error in the standard GWT *.nocache.js file.

    function B() {
        var b = false;
        try {
        var c = Window.location.search;
        return (c.indexOf("gwt.hosted=") != -1 
            || (c.indexOf("gwt.codesvr=") != -1
            || Window.external && Window.external.gwtOnLoad)) 
            && c.indexOf("gwt.hybrid") == -1
        } catch (a) {}
        B = function () {
        return b
        };
        return b
    }
    // and later, if B() returns false, show recompile error
    if (!B()) {
        try {
        alert(Pb);
        return;
        }
      ...
    }
    

    Thus, to prevent the compiler message

    • don't have gwt.hybrid in the URL
    • AND DON't have gwt.hosted=
    • OR get.codesvr=
    • OR a Window.external.getOnLoad method

    So, in the case of the popup, some server code was redirecting a DevMode session url, but not adding back the "codesvr=" parameter, hence the warning was shown.

提交回复
热议问题