Fwd: amber crashes -- what could be wrong?

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

Fwd: amber crashes -- what could be wrong?

onierstrasz

Hi Folks,

Pablo and I are down to the last file we need to recompile in RoAmber. We have all the other dependencies compiled, but now amber crashes with a very strange message.  It appears that "module" is set to nil in the JS code somewhere. We had a quick look at the JS code in amberc (line 423) but it did not enlighten us.

Any ideas?

Cheers,
Oscar

https://github.com/pestefo/roamber12/blob/master/projects/roamber/st/ARoassal-Demo.st


+ /Users/oscar/Desktop/amber-projects/roamber12/bin/amberc -v -l Canvas,ARoassal,Graph-ET-Core,ARoassal-Event,ARoassal-Layout,ARoassal-Interaction,Roassal-Amber-Extensions,RoassalExtras-Geo,Roassal-Plot,Roassal-Builder-Punchcard -L /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js -n roamber -D /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js ARoassal-Demo.st

Checking: ARoassal-Demo.st
Resolving: boot.js
...
Resolving: Roassal-Builder-Punchcard.js
Loading file: /Users/oscar/Desktop/amber-projects/roamber12/support/boot.js
...
Loading file: /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js/Roassal-Builder-Punchcard.js

undefined:123
       return module.require.apply(module, arguments);
                    ^
TypeError: Cannot read property 'require' of undefined
   at req (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:123:22)
   at stringRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:199:28)
   at amdRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:94:24)
   at eval (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:156:24)
   at Array.map (native)
   at runFactory (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:155:25)
   at stringRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:195:28)
   at amdRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:94:24)
   at eval (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:156:24)
   at Array.map (native)
+ exit
logout

[Process completed]



--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber crashes -- what could be wrong?

onierstrasz

OK, it turns out some of the lib dependencies were not needed.  Now the file compiles.  But I still don't understand why unnecessary lib dependencies would cause amberc to crash …

Experimentation showed that compiling a nearly empty .st file would cause amberc to crash if I specified a dependency to any of the following js files (previously compiled from the corresponding st):

Roassal-Amber-Extensions
Roassal-Builder-Punchcard
Roassal-Plot
RoassalExtras-Geo

https://github.com/pestefo/roamber12/tree/master/projects/roamber/js

For example: [NB: TEST.st just contains a dummy class definition and compiles fine w/o the dependency on Roassal-Plot]

/Users/oscar/Desktop/amber-projects/roamber12/bin/amberc -v -l Roassal-Plot -L /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js -n roamber -D /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber TEST.st
Checking: TEST.st
Resolving: boot.js
...
Resolving: Roassal-Plot.js
Loading file: /Users/oscar/Desktop/amber-projects/roamber12/support/boot.js
...
Loading file: /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js/Roassal-Plot.js

undefined:123
        return module.require.apply(module, arguments);
                     ^
TypeError: Cannot read property 'require' of undefined
    at req (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:123:22)
    at stringRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:199:28)
    at amdRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:94:24)
    at eval (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:156:24)
    at Array.map (native)
    at runFactory (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:155:25)
    at stringRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:195:28)
    at amdRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:94:24)
    at eval (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:156:24)
    at Array.map (native)
+ exit


Oscar

On Dec 17, 2013, at 4:45 PM, Oscar Nierstrasz <[hidden email]> wrote:

>
> Hi Folks,
>
> Pablo and I are down to the last file we need to recompile in RoAmber. We have all the other dependencies compiled, but now amber crashes with a very strange message.  It appears that "module" is set to nil in the JS code somewhere. We had a quick look at the JS code in amberc (line 423) but it did not enlighten us.
>
> Any ideas?
>
> Cheers,
> Oscar
>
> https://github.com/pestefo/roamber12/blob/master/projects/roamber/st/ARoassal-Demo.st
>
>
> + /Users/oscar/Desktop/amber-projects/roamber12/bin/amberc -v -l Canvas,ARoassal,Graph-ET-Core,ARoassal-Event,ARoassal-Layout,ARoassal-Interaction,Roassal-Amber-Extensions,RoassalExtras-Geo,Roassal-Plot,Roassal-Builder-Punchcard -L /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js -n roamber -D /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js ARoassal-Demo.st
>
> Checking: ARoassal-Demo.st
> Resolving: boot.js
> ...
> Resolving: Roassal-Builder-Punchcard.js
> Loading file: /Users/oscar/Desktop/amber-projects/roamber12/support/boot.js
> ...
> Loading file: /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js/Roassal-Builder-Punchcard.js
>
> undefined:123
>       return module.require.apply(module, arguments);
>                    ^
> TypeError: Cannot read property 'require' of undefined
>   at req (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:123:22)
>   at stringRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:199:28)
>   at amdRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:94:24)
>   at eval (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:156:24)
>   at Array.map (native)
>   at runFactory (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:155:25)
>   at stringRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:195:28)
>   at amdRequire (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:94:24)
>   at eval (eval at <anonymous> (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16), <anonymous>:156:24)
>   at Array.map (native)
> + exit
> logout
>
> [Process completed]
>
>
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: amber crashes -- what could be wrong?

Herby Vojčík
In reply to this post by onierstrasz
This is code that is injected from amdefine (it is in node_modules, somewhere). It happens when there is unmet dependency in define() or require() call somewhere, during compilation - this line should not be actually run, because it is trying to use node.js's require as a fallback, which should not happen while compiling amber unless some dependency is missing.

Find that line in amdefine.js, put a console.log there, run the compilation again and you will see what is required, which can point you the right way.

(It can probably be made better, since that function can be injected, so compiler output could be made better)

Herby

Oscar Nierstrasz wrote:
> Hi Folks,
>
> Pablo and I are down to the last file we need to recompile in RoAmber. We have all the other dependencies compiled, but now amber crashes with a very strange message.  It appears that "module" is set to nil in the JS code somewhere. We had a quick look at the JS code in amberc (line 423) but it did not enlighten
 us.

>
> Any ideas?
>
> Cheers,
> Oscar
>
> https://github.com/pestefo/roamber12/blob/master/projects/roamber/st/ARoassal-Demo.st
>
>
> + /Users/oscar/Desktop/amber-projects/roamber12/bin/amberc -v -l Canvas,ARoassal,Graph-ET-Core,ARoassal-Event,ARoassal-Layout,ARoassal-Interaction,Roassal-Amber-Extensions,RoassalExtras-Geo,Roassal-Plot,Roassal-Builder-Punchcard -L /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js -n roamber -D /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js ARoassal-Demo.st
>
> Checking: ARoassal-Demo.st
> Resolving: boot.js
> ...
> Resolving: Roassal-Builder-Punchcard.js
> Loading file: /Users/oscar/Desktop/amber-projects/roamber12/support/boot.js
> ...
> Loading file: /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js/Roassal-Builder-Punchcard.js
>
> undefined:123
>         return module.require.apply(module, arguments);
>                      ^
> TypeError: Cannot read property 'require' of undefined
>    
at req (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:123:22)
>     at stringRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:199:28)
>     at amdRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:94:24)
>     at eval (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:156:24)
>     at Array.map (native)
>     at runFactory (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:155:25)
>     at stringRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:195:28)
>     at amdRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:94:24)
>     at ev
al (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:156:24)
>     at Array.map (native)
> + exit
> logout
>
> [Process completed]
>
>
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber crashes -- what could be wrong?

Herby Vojčík
In reply to this post by onierstrasz


Oscar Nierstrasz wrote:
> OK, it turns out some of the lib dependencies were not needed.  Now
> the file compiles.  But I still don't understand why unnecessary lib
> dependencies would cause amberc to crash …

They are loaded, to be present for the compiled file (much like
<script>s in web page <head>). But they have
their own dependencies, and they may be missing. IOW, the set of
dependencies you pass to the compiler must be self-contained (compiler
does not map namespaces to paths - it just loads the dependencies and
when all are present, it works; the question why is it this way (because
it evolved incrementally from previous version which was file-based and
it is still) and if it would be better to just include path mappings
instead is different question - for simple compiles, listing mere files
is simpler, IMO).

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber crashes -- what could be wrong?

onierstrasz

Yes, my bad.  Now that you mention it, it is "obvious".  When I include all the recursive dependencies, the dummy file compiles fine with all the different unneeded dependencies.  As before, I was thrown off by the very strange error message.

BTW, RoAmber is now working with Amber 0.12.  Thanks for all the help!

https://github.com/pestefo/roamber12

Oscar

On Dec 17, 2013, at 5:37 PM, Herby Vojčík <[hidden email]> wrote:

>
>
> Oscar Nierstrasz wrote:
>> OK, it turns out some of the lib dependencies were not needed.  Now
>> the file compiles.  But I still don't understand why unnecessary lib
>> dependencies would cause amberc to crash …
>
> They are loaded, to be present for the compiled file (much like <script>s in web page <head>). But they have
> their own dependencies, and they may be missing. IOW, the set of
> dependencies you pass to the compiler must be self-contained (compiler
> does not map namespaces to paths - it just loads the dependencies and
> when all are present, it works; the question why is it this way (because
> it evolved incrementally from previous version which was file-based and
> it is still) and if it would be better to just include path mappings
> instead is different question - for simple compiles, listing mere files
> is simpler, IMO).
>
> Herby
>
> --
> You received this message because you are subscribed to the Google Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: amber crashes -- what could be wrong?

Nicolas Petton
In reply to this post by Herby Vojčík
Looking at Oscar's experience of migrating amber code to 0.12.x shows
that the user experience of the CLI tools can be greatly improved, and
that simply by adding better and more explicit error messages.

I think we should put that in high priority for 0.13.

Cheers,
Nico

Herby Vojčík writes:

> This is code that is injected from amdefine (it is in node_modules, somewhere). It happens when there is unmet dependency in define() or require() call somewhere, during compilation - this line should not be actually run, because it is trying to use node.js's require as a fallback, which should not happen while compiling amber unless some dependency is missing.
>
> Find that line in amdefine.js, put a console.log there, run the compilation again and you will see what is required, which can point you the right way.
>
> (It can probably be made better, since that function can be injected, so compiler output could be made better)
>
> Herby
>
> Oscar Nierstrasz wrote:
>> Hi Folks,
>>
>> Pablo and I are down to the last file we need to recompile in RoAmber. We have all the other dependencies compiled, but now amber crashes with a very strange message.  It appears that "module" is set to nil in the JS code somewhere. We had a quick look at the JS code in amberc (line 423) but it did not enlighten
>  us.
>>
>> Any ideas?
>>
>> Cheers,
>> Oscar
>>
>> https://github.com/pestefo/roamber12/blob/master/projects/roamber/st/ARoassal-Demo.st
>>
>>
>> + /Users/oscar/Desktop/amber-projects/roamber12/bin/amberc -v -l Canvas,ARoassal,Graph-ET-Core,ARoassal-Event,ARoassal-Layout,ARoassal-Interaction,Roassal-Amber-Extensions,RoassalExtras-Geo,Roassal-Plot,Roassal-Builder-Punchcard -L /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js -n roamber -D /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js ARoassal-Demo.st
>>
>> Checking: ARoassal-Demo.st
>> Resolving: boot.js
>> ...
>> Resolving: Roassal-Builder-Punchcard.js
>> Loading file: /Users/oscar/Desktop/amber-projects/roamber12/support/boot.js
>> ...
>> Loading file: /Users/oscar/Desktop/amber-projects/roamber12/projects/roamber/js/Roassal-Builder-Punchcard.js
>>
>> undefined:123
>>         return module.require.apply(module, arguments);
>>                      ^
>> TypeError: Cannot read property 'require' of undefined
>>    
> at req (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:123:22)
>>     at stringRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:199:28)
>>     at amdRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:94:24)
>>     at eval (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:156:24)
>>     at Array.map (native)
>>     at runFactory (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:155:25)
>>     at stringRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:195:28)
>>     at amdRequire (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:94:24)
>>     at ev
> al (eval at<anonymous>  (/Users/oscar/Desktop/amber-projects/roamber12/cli/support/amberc.js:423:16),<anonymous>:156:24)
>>     at Array.map (native)
>> + exit
>> logout
>>
>> [Process completed]
>>
>>
>>


--
Nicolas Petton
http://nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.