Conditional Defines not recognised in Pas2JS

I have added some conditional defines to a webcore project and while Delphi seems to recognise them Pas2JS doesn't. Here is an example:

when compiling I get the exception:

image

Any ideas?

Where did you do the define?
If at project level, you should see the define on the command-line like

-dDEFINENAME

it is defined in project options

it is not being picked up for the PAS2JS command line which has -dDEBUG -dPAS2JS -dWEBLIB

A TMS WEB Core app isn't compiled with the Delphi compiler but with the pas2js transpiler.
The settings are under TMS WEB project options:

All these years with webcore and I never realised that. I thought that the command line string for Pas2JS would be taken from the project settings.

Obviously need to put them in both places.

Thanks