Recent

Author Topic: Help with installation of pas2js  (Read 3549 times)

Ever

  • New Member
  • *
  • Posts: 32
Help with installation of pas2js
« on: March 05, 2019, 01:32:39 am »
Greetings to all

  I need to please explain to me how I correctly install pas2js in lazarus 2.0.0 for windows. I have already downloaded the Snapshots version but I can not get it to work. When installing lazarus in the components folder, there exists the pas2js folder, but I understand that what exists there alone is not enough. What else should I do to make it work? I have read the information of lazarus pas2js integration, but still I can not make it work. If someone has done it, you can explain the installation procedure step by step.

Thank you in advance for the support.

Ever Delgado

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • I like bugs.
Re: Help with installation of pas2js
« Reply #1 on: March 05, 2019, 07:01:02 am »

Ever

  • New Member
  • *
  • Posts: 32
Re: Help with installation of pas2js
« Reply #2 on: March 06, 2019, 05:00:33 pm »
Someone who has already installed it can not do a step-by-step explanation of the correct way to operate it ?. Not everyone has extensive knowledge in the field. As much as they refer to pages and other links, none clearly explains the correct way of installation.
Thank you

m.abudrais

  • New Member
  • *
  • Posts: 47
Re: Help with installation of pas2js
« Reply #3 on: March 06, 2019, 07:23:53 pm »
I   followed the instruction here http://wiki.freepascal.org/lazarus_pas2js_integration
1- Install the package pas2jsdsgn.
2-Then set the path of pas2js.
3- create a new project Choose web browser application.
4- build the application and you get  html file,that is your Application.
 you should give more details  of  your problem, what did you do?
« Last Edit: March 06, 2019, 07:43:38 pm by m.abudrais »

af0815

  • Sr. Member
  • ****
  • Posts: 387
Re: Help with installation of pas2js
« Reply #4 on: March 06, 2019, 08:13:36 pm »
When i do this
I   followed the instruction here http://wiki.freepascal.org/lazarus_pas2js_integration
1- Install the package pas2jsdsgn.
2-Then set the path of pas2js.
3- create a new project Choose web browser application.
4- build the application and you get  html file,that is your Application.
 you should give more details  of  your problem, what did you do?

When i do this, i get
Quote
Pas2JS Compiler version 1.1.1 [2019/02/10] for Win32 i386
Info: (132) Message encoding is utf-8
Copyright (c) 2018 Free Pascal team.
Info: (126) Parsing D:\data\Versuche\js\project1.lpr ...
D:\data\Versuche\js\project1.lpr(5,5) Error: (3073) can't find unit "System"
Fatal: (118) Compilation aborted

So the first question is, where should the snapshot or svn checkout placed. Because i have the pas2js.exe found in my fpc bin path.
regards
Andreas

m.abudrais

  • New Member
  • *
  • Posts: 47
Re: Help with installation of pas2js
« Reply #5 on: March 06, 2019, 08:51:21 pm »
i have pas2js.exe  in separate path,(download folder!)it has no relation to fpc path.
i use version pas2js-windows-1.0.4 .
extract the snapshot in separate folder ,if the problem still exist then check pas2js.cfg file.
http://wiki.freepascal.org/pas2js.cfg

af0815

  • Sr. Member
  • ****
  • Posts: 387
Re: Help with installation of pas2js
« Reply #6 on: March 06, 2019, 10:33:18 pm »
Now i have the pas2js.exe twice. One time in the bin dir of fpc and in thze bin dir of the transpiler..

I use now the svn version and have recompiled wit clean all. This will also produce a valid pas2js.cfg file. With the path corrected for pas2js.exe in  the options of lazarus it will compile. And 'Hello world' is ok.


Now i try to open a demo (demortti) of the transpiler (in the svn), add the needed package to lazarus and want to compile ->   
Quote
Panic: internal error: cannot find executable "pas2js"

It looks all demos in demo/rtl are not to compile. Always the executable is not found.


regards
Andreas

Ever

  • New Member
  • *
  • Posts: 32
Re: Help with installation of pas2js
« Reply #7 on: March 07, 2019, 03:26:40 am »
even though I install the pas2jsdsgn package, it does not appear in the components palette.

af0815

  • Sr. Member
  • ****
  • Posts: 387
Re: Help with installation of pas2js
« Reply #8 on: March 07, 2019, 06:32:52 am »
It installs in Options of Lazarus and add a new projecttypes. So nothing is shown in the componentpalette, pas2js is not a component it is an extension of Lazarus itself.
regards
Andreas

m.abudrais

  • New Member
  • *
  • Posts: 47
Re: Help with installation of pas2js
« Reply #9 on: March 07, 2019, 01:55:39 pm »
for me some demos work, and some didn't.
for demos which give
 
Quote
Panic: internal error: cannot find executable "pas2js"

i fixed that error by opening the .lpi file and replace $MakeExe(pas2js)
by
$(pas2js)
some demo like(fpreport) depends on server application which need fpc 3.2 to compile.
if compile succeed but you get empty page  in webbrowser you can fix that by modify js file name in html file.
« Last Edit: March 07, 2019, 02:02:01 pm by m.abudrais »

jshah

  • Full Member
  • ***
  • Posts: 200
Re: Help with installation of pas2js
« Reply #10 on: March 07, 2019, 04:18:37 pm »
I am having following issue:
when running demo : pas2js/demo/rtl/demostringlist.lpi

Project: Executing command before: Exit code 1, Errors: 1, Warnings: 2
sysutils.pas(1991,37) Warning: Bitwise operation is 32-bit
sysutils.pas(3960,20) Warning: Bitwise operation is 32-bit
Fatal: custom JS file not found: "rtl.js"

jshah

  • Full Member
  • ***
  • Posts: 200
Re: Help with installation of pas2js
« Reply #11 on: March 08, 2019, 05:06:53 pm »
I found the issue:
rtl.js is not exist instead pas2js_rtl.js
but in lazarus project-option -> custome-option still shows rtl.js

replace with following I am able to compile
-Jeutf-8 -Jipas2js_rtl.js -Jc -Jminclude

jshah

  • Full Member
  • ***
  • Posts: 200
Re: Help with installation of pas2js
« Reply #12 on: March 08, 2019, 05:23:59 pm »
My Installation procedure:

1. Download pas2js create a new directory and extract zip into

2. Update pas2js path in Lazarus Option

3. change rtl.js file to pas2js_rtl.js in Project Option -> Custom Option

4. I don't have any pas2js in main fpc installation directory and fpc and lazarus installed through fpcupdeluex


kotakomputer

  • New member
  • *
  • Posts: 5
Re: Help with installation of pas2js
« Reply #13 on: November 17, 2019, 06:04:26 pm »
I face similiar issue. the installation procedure not written very well: no step by step using numbering order, no detail picture and no real sample.
So, based on this forum answer, I try to complete the Wiki at:
HTH
« Last Edit: November 17, 2019, 06:05:58 pm by kotakomputer »