Compileserver (simpleserver) with pas2js lazarus / 76-Pas2JS ---------------------------------------------------------------------- mangakissa · 2019-02-25 14:02 I have in options the path to the simpleserver (now compileserver) set to C:\lazarus\components\pas2js\bin\compileserver.exe on port 3000. If I create a new app, I set in the configfile that a server is needed on port 3000. Then I put the line writeln('hello') and compile it without errors. Then I run the app without debugging. Nothing happens. When I want to run for the second time, it comes with the errer "file not open" How can I use simpleserver with pas2js? ---------------------------------------------------------------------- mattias · 2019-02-25 14:14 You can start compilerserver with option -s, then it will behave like simpleserver. Or you can build simpleserver. Its sources can be found in fpc trunk packages/fcl-web/examples/simpleserver/ ---------------------------------------------------------------------- d-_-b · 2024-02-16 10:56 Im trying to create a Web Browser Application from New Project. I setup my global options as on the wiki. Compiled `fpcsrc\packages\fcl-web\examples\simpleserver` manually and changed path of compileserver from $MakeExe(IDE,simpleserver) to `C:\lazarus\fpc\3.2.2\source\packages\fcl- web\examples\simpleserver\simpleserver.exe`. When I run the project I get the following: Simple Web Server: Wrong compileserver exe: simpleserver does not support --version, maybe this is an old version? see Tools / Options / Environment / Simple Web Server / Simpleserver Where can i find the correct compileserver.exe with --version support? I'm using Lazarus 3.0 (rev lazarus_3_0) FPC 3.2.2 x86_64-win64-win32/win64 with the latest pas2js main git branch. Thanks, ---------------------------------------------------------------------- TRon · 2024-02-16 11:22 Quote from: d-_-b on February 16, 2024, 11:56:48 amWhere can i find the correct compileserver.exe with --version support? The version option was added last year in trunk (see commit) so you would have to download the sources from trunk and compile it manually to create the (correct) executable. ---------------------------------------------------------------------- Thaddy · 2024-02-16 16:51 You are aware the compiler itself can run as cgi? You only need to provide an interface. ---------------------------------------------------------------------- d-_-b · 2024-02-19 08:05 Quote from: TRon on February 16, 2024, 12:22:47 pmThe version option was added last year in trunk (see commit) so you would have to download the sources from trunk and compile it manually to create the (correct) executable. Thank you, I used fpcupdeluxe-x86_64-win64.exe and compiled fpc trunk(lazarus failed see below), I then compiled C:\fpcupdeluxe\fpcsrc\packages\fcl- web\examples\simpleserver using lazarus 3 ide i download from the web. Had to change lazarus Tools > Options > Env, compiler to C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.exe and fpc source to C:\fpcupdeluxe\fpcsrc\. Now I can run "Web Browser Application from New Project". I had another problem, c:\prj\pas>pas2js -Jc -Jirtl.js -Tbrowser astar.js astar.js(1,4) Error: can't find unit "System" Fatal: Compilation aborted I added -vt to pas2js for more verbose config debugging and realised the pas2js.cfg is broken for package directory using unix pathing(/) instead of windows pathing(\), changed: #IFDEF FPC_SUBTARGET_NAMESPACED -Fu$CfgDir\..\..\packages/*/*/namespaced -Fi$CfgDir\..\..\packages/*/*/src #else -Fu$CfgDir\..\..\packages/*/*/src To #IFDEF FPC_SUBTARGET_NAMESPACED -Fu$CfgDir\..\..\packages\*\namespaced -Fi$CfgDir\..\..\packages\*\src #else -Fu$CfgDir\..\..\packages\*\src Enabling me to compile the pas2js trunk demo's and the stackoverflow astar.pas example(running on jsfiddle). C:/fpcupdeluxe/fpc/bin/x86_64-win64/fpc.exe -MObjFPC -Scghi -O1 -g -gl -l -venibq -vw-h- -vm6058,3057 -Fu. -Fu../../packager/units/x86_64-win64 -Fu../lazdebuggers/lazdebuggerintf/lib/x86_64-win64 -Fu../lazutils/lib/x86_64-win64 -Fu../debuggerintf/lib/x86_64-win64 -Fu../freetype/lib/x86_64-win64 -Fu../../lcl/units/x86_64-win64 -FuC:/fpcupdeluxe/fpcsrc/rtl -FE. -FUlib/x86_64-win64 -vw-n-h-l-d-u-t- p-c- -g -gl -dx86_64 fpdebug.pas (1002) Target OS: Win64 for x64 (3104) Compiling fpdebug.pas (3104) Compiling fpdbgclasses.pp (3104) Compiling fpdbgutil.pp C:\fpcupdeluxe\lazarus\components\fpdebug\fpdbgutil.pp(115,52) Error: (4003) Type identifier expected C:\fpcupdeluxe\lazarus\components\fpdebug\fpdbgutil.pp(115,52) Error: (4009) Class type expected, but got "" C:\fpcupdeluxe\lazarus\components\fpdebug\fpdbgutil.pp(116,16) Error: (3058) There is no method in an ancestor class to be overridden: "PushItem(const TFpThreadWorkerItem):System.Boolean;" C:\fpcupdeluxe\lazarus\components\fpdebug\fpdbgutil.pp(229,1) Fatal: (10026) There were 3 errors compiling module, stopping Fatal: (1018) Compilation aborted Error: C:\fpcupdeluxe\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode make.exe[1]: *** [lazbuildlclpackages] Error 2 C:\fpcupdeluxe\fpcbootstrap\make.exe: *** [lazbuild] Error 2 fpcupdeluxe: ERROR: Lazarus Native Installer (BuildModuleCustom: Lazbuild): make.exe returned exit status #2. Quote from: Thaddy on February 16, 2024, 05:51:04 pmYou are aware the compiler itself can run as cgi? You only need to provide an interface. No, want to give a example? Was just following the docs on pas2js on the wiki, ---------------------------------------------------------------------- TRon · 2024-02-19 08:16 Quote from: d-_-b on February 19, 2024, 09:05:26 amThank you, You're welcome  QuoteI used fpcupdeluxe-x86_64-win64.exe and compiled fpc trunk(lazarus failed see below), .... You must have had the worst timing ever  This issue was closed a couple of hours ago so if you try to compile trunk again then the particular issue for which you posted the error- log, should be fixed now. BTW thank you very much for posting the error-log as it make things more clear about what exactly you are dealing with. Also thank you very6 much for the other hints and tips.