Exporting error and empty .js file

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

Exporting error and empty .js file

vpena
Hello!

I'm trying to export an application from Pharo to Amber, and everything works find except when it has to write the .js file. It give me the following error + and empty .js file:

String>>streamContents:
a BlockClosure>>value:
a Exporter>>exportPackageDefinitionOf:on:
nil does not understand #name

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: First argument needs to be a number, array or string.
    at new Buffer (buffer.js:156:15)
    at Object.writeFileSync (fs.js:485:12)
    at /home/projects/Amber/Amber/mySrc/amberc.0ZLAPg/compiler.js:18557:8
    at Array.forEach (native)
    at Object.<anonymous> (/home/projects/Amber/Amber/mySrc/amberc.0ZLAPg/compiler.js:18549:11)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)
Done.

Any idea?

Thanks,
Vanessa.
Reply | Threaded
Open this post in threaded view
|

Re: Exporting error and empty .js file

Herby Vojčík
Hello.

You have no package: in class definitions, probably; and exporter fails
for non-packaged classes.

You should work around this... one possibility is to patch
Class>>subclass:instanceVariableNames: to use some string like 'Sandbox'
instead of nil and restart the export/import.

Or patch the Class>>package to return something meaningful.

Herby

vpena wrote:

> Hello!
>
> I'm trying to export an application from Pharo to Amber, and everything
> works find except when it has to write the .js file. It give me the
> following error + and empty .js file:
>
> String>>streamContents:
> a BlockClosure>>value:
> a Exporter>>exportPackageDefinitionOf:on:
> nil does not understand #name
>
> node.js:134
>          throw e; // process.nextTick error, or 'error' event on first tick
>          ^
> Error: First argument needs to be a number, array or string.
>      at new Buffer (buffer.js:156:15)
>      at Object.writeFileSync (fs.js:485:12)
>      at /home/projects/Amber/Amber/mySrc/amberc.0ZLAPg/compiler.js:18557:8
>      at Array.forEach (native)
>      at Object.<anonymous>
> (/home/projects/Amber/Amber/mySrc/amberc.0ZLAPg/compiler.js:18549:11)
>      at Module._compile (module.js:402:26)
>      at Object..js (module.js:408:10)
>      at Module.load (module.js:334:31)
>      at Function._load (module.js:293:12)
>      at Array.<anonymous>  (module.js:421:10)
> Done.
>
> Any idea?
>
> Thanks,
> Vanessa.
Reply | Threaded
Open this post in threaded view
|

Re: Exporting error and empty .js file

vpena
Thanks for your reply, Herby.
Finally my problem was that my category name had a "-" in its name, so it wasn't recognized. Everything works now.

Vanessa.
Reply | Threaded
Open this post in threaded view
|

Re: Exporting error and empty .js file

vpena
Nops, sorry, my mistake. It was because the name of the category has different name than the . st file. I missed that instruction.

Thanks.