# Problem with JavaScript execution

**URL:** https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572
**Category:** Bugs
**Created:** [November 19, 2024, 7:46am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572 "2024-11-19T07:46:11Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![MHart1](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MHart1](https://www.finalbuilder.com/forums/u/MHart1)
#### Post date: [November 19, 2024, 7:46am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/1 "2024-11-19T07:46:11Z")

</div>

I am using version 8.0.0.3390 of Finalbuilder, and since my computer updated to Windows 11 Pro 24H2, I’m getting an error message when I call actions with JavaScript.

Here is the error message:  
dotnet Build - [ZebraPicking]  
Status:  
Date: 19/11/2024  
Time: 07:33:22:442  
End: 07:33:22:487  
Duration: 00:00:00:045

Action Messages:  
Working Folder : C:.NET\Clientes\Dispreu\ZebraPicking  
Command Line : build C:.NET\Clientes\Dispreu\ZebraPicking\ZebraPicking.sln --configuration Release --framework net8.0-windows --verbosity normal  
Error Executing script : BeforeExecute  
Error en tiempo de ejecución de JavaScript  
El objeto no acepta esta propiedad o método  
In Action CommonScript, Line: 6  
Char : 1

Here is a snapshot:

 ![Captura de pantalla 2024-11-19 083006](https://www.finalbuilder.com/forums/uploads/default/original/2X/b/b85805bfbc3bd6bfe4a1ea54212cdcc01c7f00dc.png)

Can you help me to find a solution?

I’m really not too sure where the problem lies, with Windows of with al updated JavaScipt or with Finalbuilder.

Thanks,  
Martin.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 19, 2024, 8:36am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/2 "2024-11-19T08:36:42Z")

</div>

> [@MHart1](#):
>
> JavaScript runtime error  
> The object does not support this property or method  
> In Action CommonScript, Line: 6

This suggests to me that BuildVer is not defined.

---

<div class="post-metadata">

### Author: ![MHart1](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MHart1](https://www.finalbuilder.com/forums/u/MHart1)
#### Post date: [November 19, 2024, 9:38am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/3 "2024-11-19T09:38:51Z")

</div>

Hi Vincent,

I’m trying to use this script you sent me many (many) years ago:

```auto
var currentDate = new Date();
var comparisonDate = new Date(2000, 1, 1);
var difference = currentDate - comparisonDate;
BuildVer = Math.floor(difference / 86400000);

```

But even although it’s still marked as VBScript, it seems the script is no longer valid within FB.  
I cant see hao to access the global variable BuildVer from within the script.

I have modified the script to

```auto
currentDate = Date()
comparisonDate = #2000/01/01#
difference = currentDate - comparisonDate
---> BuildVer = difference

```

I have also marked the script language to JavaScript.

Thanks,  
Martin.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 19, 2024, 10:17am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/4 "2024-11-19T10:17:25Z")

</div>

Hi Martin

I searched the forums and found the original post with the script we gave you, and it did mention that BuildVer is a FinalBuilder project variable. So you need to define the variable in your project.

I just tested the original script here (Javascript) - with the FB variable defined and it worked first time.

---

<div class="post-metadata">

### Author: ![MHart1](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MHart1](https://www.finalbuilder.com/forums/u/MHart1)
#### Post date: [November 19, 2024, 10:54am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/5 "2024-11-19T10:54:11Z")

</div>

Hi Vincent,

Hmm, I’m begginig to think this is a machine specific error. The project is years old and has always worked fine. I have attached a snapshot of the variable declaration and the error message.

 ![2024-11-19_11-44-33](https://www.finalbuilder.com/forums/uploads/default/original/2X/7/7a417d8831b5f9778d2bf645e7a7ab75186d568f.jpeg)  
 ![2024-11-19_11-47-06](https://www.finalbuilder.com/forums/uploads/default/original/2X/3/3abb483f1b8f1c3a0bb82a4d4befc44345707bf5.jpeg)  
The message (in Spanish) says:  
Uncontrolled exception: (“The object does not accept this propery or method”)

When I open the Finalbuilder in debug (under Visual Studio) the error message clearly states that the line 5 column 1 is the culprit. So it seems that for some reason, the BuildVer variable is no being ‘seen’ inside the JavaScript.

Regards,  
Martin.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 19, 2024, 11:24am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/6 "2024-11-19T11:24:50Z")

</div>

If you send the project to support @ finalbuilder .com I’ll take a look at it and see if I can figure out what is causing the issue.

---

<div class="post-metadata">

### Author: ![MHart1](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MHart1](https://www.finalbuilder.com/forums/u/MHart1)
#### Post date: [November 20, 2024, 12:54pm UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/7 "2024-11-20T12:54:48Z")

</div>

Hi Vincent,

I’ve sent the project to the indicated email address.

Regards,  
Martin.

---

<div class="post-metadata">

### Author: ![danielrail](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/53a042/32.png) [@danielrail](https://www.finalbuilder.com/forums/u/danielrail)
#### Post date: [November 21, 2024, 3:56pm UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/8 "2024-11-21T15:56:11Z")

</div>

I’m encountering the exact same error message with the “dotnet Publish” and “dotnet Build” actions.

And, I too just upgraded to Windows 11 Pro 24H2 and .Net 9 tools(with the latest Visual Studio 2022 17.12 and the dotnet.exe is version 9.0.100). It doesn’t matter which FinalBuilder build script that I have, they all fail with any dotnet action, that I use (dotnet Build and dotnet Publish). And, if I run the dotnet publish, with the command line parameters that FinalBuilder is using, directly in the command line prompt, it works, but fails in FinalBuilder.

Everything was working before upgrading to Windows 11 Pro 24H2 and Visual Studio 2022 17.12.

I hope that this information helps.

---

<div class="post-metadata">

### Author: ![MHart1](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MHart1](https://www.finalbuilder.com/forums/u/MHart1)
#### Post date: [November 21, 2024, 4:59pm UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/9 "2024-11-21T16:59:41Z")

</div>

Exactly the same here with dotnet build and publish. If I run them just executing the command from Execute Program action, using the same command line arguments as FinalBuilder, it works okay.  
Thanks for your input, it seems that it is not a machine specific error after all.  
Regards,  
Martin.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 21, 2024, 9:33pm UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/10 "2024-11-21T21:33:51Z")

</div>

I just upgraded to 24h2 and can confirm it has broken scripting in FinalBuilder - looking into it now.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 21, 2024, 10:25pm UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/11 "2024-11-21T22:25:04Z")

</div>

Ok, found the issue and a work around.

Windows 24h2 enables a policy by default that causes JScript.dll (the com dll) to load JScript9Legacy.dll rather than JScript9.dll.

JScript9Legacy.dll is a replacement engine using Chakra (which itself seems abandoned since Edge moved to using chromium).

The reason they did this was because of a security issue - which is understandable - but unforutnately it introduces a whole host of bugs they do not seem to interested in fixing (I guess it works for them).

This issue even affects some of Microsoft’s own applications (Visual Studio).

The workaround is to [disable the policy](https://admx.help/?Category=Windows_11_2022&Policy=Microsoft.Policies.InternetExplorer::JScriptReplacement)

Run regedit.

navigate to:

`HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main`

or

`HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Internet Explorer\Main`

Note these keys did not exist on my machine, so I added them.

Right click the Main key and select New DWORD (32-bit) Value, name the new value JScriptReplacement and the value to 0.

Restart FinalBuilder (no need to reboot).

Obviously, this is not ideal - we have been looking to replace JScript for some time - unfortunately so far our efforts have not resulted in something that is 100% backwards compatible - so we still have some work to do in this area.

---

<div class="post-metadata">

### Author: ![MHart1](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MHart1](https://www.finalbuilder.com/forums/u/MHart1)
#### Post date: [November 22, 2024, 7:34am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/12 "2024-11-22T07:34:36Z")

</div>

Perfect, that works just fine.  
Ah, those magic words, rarely found in the same sentence: ‘legacy’ and ‘backwards compatibility’ - bring back many memories, not always good ones!  
Thanks so much Vincent and the team.  
Regards,  
Martin.

---

<div class="post-metadata">

### Author: ![lsagasta](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/3ec8ea/32.png) [@lsagasta](https://www.finalbuilder.com/forums/u/lsagasta)
#### Post date: [December 10, 2024, 7:56am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/13 "2024-12-10T07:56:07Z")

</div>

Hi Vincent.

As you said it is a workaround and it is not ideal. Will be a FinalBuilder patch to fix it without changing the policy?  
Thank you in advance.

Regards.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 10, 2024, 8:47am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/14 "2024-12-10T08:47:30Z")

</div>

This is a change in Windows, not something we can patch. Ultimately we need to replace the script engines, but that is not at all an easy task. I have spent months looking into scripting engines and my conclusions are

1. VBScript is dead - there are no viable replacements
2. Javascript is not dead, but it a huge amount of work.

For Javascript we’re looking at using V8 (same as chrome) - however that is written in C++ and FinalBuilder & Automise are written in Delphi - and right now there are no really usable libraries to make using v8 possible. There are a few abandoned projects which no longer compile (well the c++ parts) - so we will probably need to hire a C++ dev to help with this - the last time I used C++ was in the early 90’s.

So there is no easy fix - for now the policy change will be required - we are not alone - Microsoft severely underestimated just how many people are still using active scripting. I wish they hadn’t abandoned Chakra Core as that was quite promising.

P.S - we do plan to update the installer to (optionally) make the change during install.

---

<div class="post-metadata">

### Author: ![marius](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@marius](https://www.finalbuilder.com/forums/u/marius)
#### Post date: [November 13, 2025, 11:40am UTC](https://www.finalbuilder.com/forums/t/problem-with-javascript-execution/7572/15 "2025-11-13T11:40:35Z")

</div>

Thanks for the answer, I can now continue!
