Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Error Cannot read property 'minWidth' of undefined while loading a screen

    Hi Isomorphic,

    I am using SmartGWT 12.1 LGPL and GWT 2.7.0

    While loading a screen, I am getting below error in browser's console,

    Cannot read property 'minWidth' of undefined

    To get read off that, I have removed all the minWidth i was setting, still no change.

    Nothing is being shown in SC.showConsole()

    Can you please provide some hint here ?

    Other screens are working fine though.

    #2
    More information should be available.

    Check the browser's built-in developer tools, and try other browsers.

    Also: how did this start happening? What did you change?

    Comment


      #3
      I upgraded from SmartGWT 4.1 to 12.1 LGPL

      The error message i could gather from Chrome's developer tools, when I compiled with -style as DETAILED

      In firefox console or GWT's legacy dev mode console it shows below error,

      Code:
      (TypeError) @com.smartgwt.client.widgets.BaseWidget::draw()([]): _9 is undefined

      Comment


        #4
        See Debugging overview. Run in SuperDevMode and get a stack trace. This is what you should be doing anyway.

        Comment


          #5
          I tried running in SuperDevMode and it not showing any error there but in browser console only it shows below error,


          Code:
          com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'minWidth' of undefined
              at Unknown.com_google_gwt_lang_Exceptions_wrap__Ljava_lang_Object_2Ljava_lang_Object_2(InsWeb-0.js)
              at Unknown.com_dclear_cmn_gwt_client_SafeUiRunner_run__V(InsWeb-0.js)
              at Unknown.com_dclear_cmn_gwt_client_SafeUiRunner_SafeUiRunner__Ljava_lang_String_2V(InsWeb-0.js)
              at Unknown.new com_dclear_cmn_gwt_client_AbstractDataHandler$2_AbstractDataHandler$2__Lcom_dclear_cmn_gwt_client_AbstractDataHandler_2Ljava_lang_String_2V(InsWeb-0.js)
              at Unknown.com_dclear_cmn_gwt_client_AbstractDataHandler_onSuccess__Ljava_lang_Object_2V(InsWeb-0.js)
              at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(InsWeb-0.js)
              at Unknown.com_google_gwt_http_client_Request_fireOnResponseReceived__Lcom_google_gwt_http_client_RequestCallback_2V(InsWeb-0.js)
              at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(InsWeb-0.js)
              at Unknown.<anonymous>(InsWeb-0.js)
              at Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(InsWeb-0.js)
              at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(InsWeb-0.js)
              at Unknown.<anonymous>(InsWeb-0.js)

          Comment


            #6
            In legacy devlopment mode, we are getting below error in dev mode console,

            Code:
            com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.BaseWidget::draw()([]): _9 is undefined
                at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252)
                at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
                at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
                at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:315)
                at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
                at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java)
                at com.dclear.gwt.client.ins.InsWeb.loadAppView(InsWeb.java:111)
                at com.dclear.gwt.client.ins.InsWeb.buildApplicationPresenter(InsWeb.java:94)
                at com.dclear.gwt.client.ins.InsWeb.loadModule(InsWeb.java:117)
                at com.dclear.cmn.gwt.client.AbstractEntryPoint.loadContext(AbstractEntryPoint.java:239)
                at com.dclear.cmn.gwt.client.AbstractEntryPoint$1$1$1.handleDataLoad(AbstractEntryPoint.java:165)
                at com.dclear.cmn.gwt.client.AbstractEntryPoint$1$1$1.handleDataLoad(AbstractEntryPoint.java:1)
                at com.dclear.cmn.gwt.client.AbstractDataHandler$2.execute(AbstractDataHandler.java:133)
                at com.dclear.cmn.gwt.client.SafeUiRunner.run(SafeUiRunner.java:38)
                at com.dclear.cmn.gwt.client.SafeUiRunner.<init>(SafeUiRunner.java:32)
                at com.dclear.cmn.gwt.client.AbstractDataHandler$2.<init>(AbstractDataHandler.java:129)
                at com.dclear.cmn.gwt.client.AbstractDataHandler.onSuccess(AbstractDataHandler.java:129)
                at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
                at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:250)
                at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
                at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
                at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
                at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
                at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
                at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
                at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
                at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
                at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:299)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
                at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
                at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
                at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
                at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
                at java.lang.Thread.run(Thread.java:748)

            Comment


              #7
              I have tried with SC.showConsole()

              But no error is visible in that. Is there any way i can get the stack trace from somewhere ?

              Comment


                #8
                For one of the screen I am getting below exception,

                Code:
                com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(9468), JavaScript object(7154), JavaScript object(20211)]): _1 is undefined
                    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252)
                    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
                    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
                    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
                    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
                    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:299)
                    at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:498)
                    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
                    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
                    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
                    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
                    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
                    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
                    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:315)
                    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
                    at com.smartgwt.client.widgets.BaseWidget.setProperty(BaseWidget.java)
                    at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:1194)
                    at com.smartgwt.client.widgets.grid.ListGrid.setFields(ListGrid.java:6523)

                Comment


                  #9
                  These stack traces don't give enough information for us to help you. You need to take a look at the Debugging overview and begin simplifying your project so you can isolate the error.

                  Note that the stack traces seem like nonsense as well - your project may be corrupt in some way. You should be clearing browser caches, re-running your GWT compile, and perhaps restarting your IDE. If the error persist, you might try running the code from one of our sample projects, since if that fails, you know something is still wrong with your installation.

                  But if it works then it's time to start on isolating which part of your project is causing this error.

                  Comment


                    #10
                    Hi Isomorphic,

                    Thanks for the suggestions. I tried below things but got the same error,

                    Cleared browser cache.
                    Cleared gwt cache files from Temp folders + workspace
                    Restarted IDE
                    Build the project again.

                    Next I will try to upgrade again on an existing project (with SGWT 4.1)

                    I am also interested to know the pricing of paid support.

                    Comment


                      #11
                      You can make a few simple changes to ensure that more information is available to report to us when an error occurs:
                      • Switch to the debug versions of the SC Framework files. The help topic for this is here. Basically, you need to switch the module includes in your project to refer to the debug variants, and then if you're referring to the non-script version of SmartGwt (e.g. <inherits name="com.smartgwt.SmartGwt"/>), you also need to switch the module URLs in your HTML to the debug path (modules-debug).
                      • In the build.xml file in your project, you need to uncomment the following lines in the definition of the "gwtc" target. (For the SGWT 12.1 LGPL download, these lines can for example be found in the Showcase project.)
                      Code:
                            <!-- Additional arguments like -style DETAILED or -logLevel DEBUG -->
                            <!-- <arg line="-optimize 0"  /> -->
                            <!-- <arg line="-style PRETTY"/> -->
                      Uncommenting these lines ensures that the JS generated by GWT will have optimal readability.

                      Please also refer to the SGWT Debugging Guide.

                      If you can reproduce the legacy dev mode error in BaseWidget.draw() that you reported above after making those changes, you can potentially gather more information by setting an Eclipse breakpoint in BaseWidget.draw() and evaluating the expressions this.getID() and this.getClass(), or you could set a browser breakpoint on the JavaScript method Canvas.draw() and report this.getID() and this.getClassName().

                      Comment


                        #12
                        Hi Isomorphic,

                        Thanks for the detailed reply. I will sure try and get back to you.

                        BTW, I did try fresh upgrade on a working project but ran into same issues afterwords.

                        Comment


                          #13
                          Hi Isomorphic,

                          I would like to attach loadScriptTagFiles.js, but unable to do it due to size restriction.

                          You have mentioned about changing module URLs in html file, but we are not using that way. We have loadScriptTagFiles.js included in our module.nocache.js files.

                          Below is the snippet of loadScriptTagFiles.js generated after inheriting
                          Code:
                          com.smartgwt.debug.SmartGwtDebug
                          ,

                          Code:
                          if (!window.__gwt_scriptsLoaded) window.__gwt_scriptsLoaded = {};
                          if (!__gwt_scriptsLoaded['sc/client/language/Packager.js']) {
                            __gwt_scriptsLoaded['sc/client/language/Packager.js'] = true;
                            document.write('<script src="sc/client/language/Packager.js"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/language/startDefiningFramework.js#module=Core']) {
                            __gwt_scriptsLoaded['sc/client/language/startDefiningFramework.js#module=Core'] = true;
                            document.write('<script src="sc/client/language/startDefiningFramework.js#module=Core"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/browser/Browser.js']) {
                            __gwt_scriptsLoaded['sc/client/browser/Browser.js'] = true;
                            document.write('<script src="sc/client/browser/Browser.js"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/language/Object.js']) {
                            __gwt_scriptsLoaded['sc/client/language/Object.js'] = true;
                            document.write('<script src="sc/client/language/Object.js"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/language/IsA.js']) {
                            __gwt_scriptsLoaded['sc/client/language/IsA.js'] = true;
                            document.write('<script src="sc/client/language/IsA.js"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/language/ClassFactory.js']) {
                            __gwt_scriptsLoaded['sc/client/language/ClassFactory.js'] = true;
                            document.write('<script src="sc/client/language/ClassFactory.js"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/language/Class.js']) {
                            __gwt_scriptsLoaded['sc/client/language/Class.js'] = true;
                            document.write('<script src="sc/client/language/Class.js"></script>');
                          }
                          if (!__gwt_scriptsLoaded['sc/client/language/Function.js']) {
                            __gwt_scriptsLoaded['sc/client/language/Function.js'] = true;
                            document.write('<script src="sc/client/language/Function.js"></script>');
                          Please let me know if anything more is required.

                          Comment


                            #14
                            The loadScriptTagFiles.js file is generated by us during the compile/link process to work around GWT's lack of support for <script> tags in newer versions, and wouldn't have any error details in it. It was created for backcompat but we actually encourage people to move away from using <script> tags and just load the framework directly in their HTML, which will avoid generation of loadScriptTagFiles.js.

                            Can you provide your root HTML and project (gwt.xml) files? The intent of telling you how to configure your system for better debugging above was that you'd report a better stack to trace to us, or be able to debug in the browser and report the output of the commands requested (e.g. this.getClassName()).

                            Comment


                              #15
                              Below is root and gwt.xml files
                              dashboard.jsp CmnWeb.gwt.xml

                              this.getID = isc_VLayout_6
                              this.getClassName = VLayout

                              The stacktrace from chrome's debugger was same as i provided earlier. attaching same again,

                              Code:
                              SEVERE: handleUiException - An unexpected error has occurred at client side. You can try the operation again and if problem still persist then refresh the page and try again.(key: LazyTaskRunner.executeTask() - Class$S670)Class$S127: (TypeError) : Cannot read property 'minWidth' of undefined
                                  at Unknown.wrap_0(Unknown Source)
                                  at Unknown.draw(Unknown Source)
                                  at Unknown.loadAppView(Unknown Source)
                              The stacktrace from GWT legacy dev mode,

                              Code:
                              com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.BaseWidget::draw()([]): _9 is undefined
                                  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252)
                                  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
                                  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
                                  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:315)
                                  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
                                  at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java)
                                  at com.dclear.gwt.client.ins.InsWeb.loadAppView(InsWeb.java:122)
                              Also, as per your suggestion, i removed use of loadScriptTagFiles.js and only done using script tag in root file.
                              Attached Files
                              Last edited by pratik.thaker; 1 Jun 2020, 03:23.

                              Comment

                              Working...
                              X