I have a project group with common files between projects. Shared files have different code depending on if it is for the server or the client.
In project compiler options I define a symbol say TMSWEB for the client and I have code such as
{$ifdef TMSWEB}
Client Code
{$else}
Server Code
{$endif}
For the server, it compiles fine as TMSWEB is not defined. For the client (even if I do a build), it does not find TMSWEB defined and tries to compile incorrect code.
Does pas2js actually cope with compiler defines and does it see them from the project options? Can you try and do the define in code and see what happens?