Error loading my application

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error loading my application

Alex Schenkman
Hi list,

From the workspace I do ToDoApp main to start my application.
So I have this code on the index.html
ready: function() { smalltalk.ToDoApp._main(); }

My application starts because I can see it in my logs, but it does not show in the browser.
In other words, it is like if appendToJQuery would not work.

The console shows:
  1. boot.js:383Uncaught TypeError: Cannot read property 'canHaveChildren' of undefined
    1. Smalltalk.st.sendboot.js:383
    2. smalltalk.addMethod.smalltalk.method.fnTaskig.js:151
    3. loadAmber.readyindex.html:18
    4. window.smalltalkReadyamber.js:176
  2. (anonymous function)


    Where do I go from here? Any pointers?
    Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Error loading my application

Herby Vojčík


Alex Schenkman wrote:

> Hi list,
>
>  From the workspace I do ToDoApp main to start my application.
> So I have this code on the index.html:
> ready: function() { smalltalk.ToDoApp._main(); }
>
> My application starts because I can see it in my logs, but it does not
> show in the browser.
> In other words, it is like if appendToJQuery would not work.
>
> The console shows:
>
>    1. boot.js:383 <http://localhost:4000/js/boot.js>Uncaught TypeError:
>       Cannot read property 'canHaveChildren' of undefined
>          1.
>             Smalltalk.st.sendboot.js:383 <http://localhost:4000/js/boot.js>
>          2.
>             smalltalk.addMethod.smalltalk.method.fnTaskig.js:151
>             <http://localhost:4000/projects/taskig/js/Taskig.js>
>          3.
>             loadAmber.readyindex.html:18
>             <http://localhost:4000/projects/taskig/index.html>
>          4.
>             window.smalltalkReadyamber.js:176
>             <http://localhost:4000/js/amber.js>
>          5.
>    2.
>       (anonymous function)
>
>
>       Where do I go from here? Any pointers?
>       Thanks in advance!

Start JS console, set it to stop at any excpetion (not only uncaught one
(light-blue in Chrome, not violet or grey)).

Then issue the command from JS.

It then probably stops right at the point of failure and you can inspect
the full stack (unless it stop somewhere is jquery, where they often do
try{...}catch(all){...}).

Herby
Reply | Threaded
Open this post in threaded view
|

[solved] [amber-lang] Error loading my application

Alex Schenkman
I do not know what the problem was, but it works if I write:
ready: function() { 
   $(function() { smalltalk.ToDoApp._main(); }); 
}

instead of:
ready: function() { smalltalk.ToDoApp._main(); }

Isn't $() a JQuery expression?


On Fri, May 11, 2012 at 1:17 PM, Herby Vojčík <[hidden email]> wrote:


Alex Schenkman wrote:
Hi list,

 From the workspace I do ToDoApp main to start my application.
So I have this code on the index.html:
ready: function() { smalltalk.ToDoApp._main(); }

My application starts because I can see it in my logs, but it does not
show in the browser.
In other words, it is like if appendToJQuery would not work.

The console shows:

  1. boot.js:383 <http://localhost:4000/js/boot.js>Uncaught TypeError:

     Cannot read property 'canHaveChildren' of undefined
        1.
           Smalltalk.st.sendboot.js:383 <http://localhost:4000/js/boot.js>
        2.
           smalltalk.addMethod.smalltalk.method.fnTaskig.js:151
           <http://localhost:4000/projects/taskig/js/Taskig.js>
        3.
           loadAmber.readyindex.html:18
           <http://localhost:4000/projects/taskig/index.html>
        4.
           window.smalltalkReadyamber.js:176
           <http://localhost:4000/js/amber.js>
        5.
  2.

     (anonymous function)


     Where do I go from here? Any pointers?
     Thanks in advance!

Start JS console, set it to stop at any excpetion (not only uncaught one (light-blue in Chrome, not violet or grey)).

Then issue the command from JS.

It then probably stops right at the point of failure and you can inspect the full stack (unless it stop somewhere is jquery, where they often do try{...}catch(all){...}).

Herby

Reply | Threaded
Open this post in threaded view
|

Re: [solved] [amber-lang] Error loading my application

Herby Vojčík


Alex Schenkman wrote:
> I do not know what the problem was, but it works if I write:
> ready: function() {
>     $(function() { smalltalk.ToDoApp._main(); });
> }

I see :-)

Do this always this way unless you know what you're doing, since ...

>
> instead of:
> ready: function() { smalltalk.ToDoApp._main(); }
>
> Isn't $() a JQuery expression?

... $(function(){...}) runs function(){...} after the DOM is complete,
which is what you almost always want (yes, it is a jquery goodie; jquery
is included with amber (you can load your own version before amber if
you want user it instead of amber-packed one)).

Of course, no need for this if you know you load amber late (after the
DOM is there already). But it was not your case (it almost never the
case for pages that want to load as fast as possible).

Herby

>
>
> On Fri, May 11, 2012 at 1:17 PM, Herby Vojčík <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>
>     Alex Schenkman wrote:
>
>         Hi list,
>
>           From the workspace I do ToDoApp main to start my application.
>         So I have this code on the index.html:
>         ready: function() { smalltalk.ToDoApp._main(); }
>
>         My application starts because I can see it in my logs, but it
>         does not
>         show in the browser.
>         In other words, it is like if appendToJQuery would not work.
>
>         The console shows:
>
>            1. boot.js:383 <http://localhost:4000/js/__boot.js
>         <http://localhost:4000/js/boot.js>>Uncaught TypeError:
>
>               Cannot read property 'canHaveChildren' of undefined
>                  1.
>                     Smalltalk.st.sendboot.js:383
>         <http://localhost:4000/js/__boot.js
>         <http://localhost:4000/js/boot.js>>
>                  2.
>                     smalltalk.addMethod.smalltalk.__method.fnTaskig.js:151
>         <http://localhost:4000/__projects/taskig/js/Taskig.js
>         <http://localhost:4000/projects/taskig/js/Taskig.js>>
>                  3.
>                     loadAmber.readyindex.html:18
>         <http://localhost:4000/__projects/taskig/index.html
>         <http://localhost:4000/projects/taskig/index.html>>
>                  4.
>                     window.smalltalkReadyamber.js:__176
>         <http://localhost:4000/js/__amber.js
>         <http://localhost:4000/js/amber.js>>
>                  5.
>            2.
>
>               (anonymous function)
>
>
>               Where do I go from here? Any pointers?
>               Thanks in advance!
>
>
>     Start JS console, set it to stop at any excpetion (not only uncaught
>     one (light-blue in Chrome, not violet or grey)).
>
>     Then issue the command from JS.
>
>     It then probably stops right at the point of failure and you can
>     inspect the full stack (unless it stop somewhere is jquery, where
>     they often do try{...}catch(all){...}).
>
>     Herby
>
>