Search found 10 matches

by samw
Fri Apr 17, 2026 6:16 pm
Forum: Node.js scripting
Topic: VisualStudioCode reports messages
Replies: 6
Views: 516

Re: VisualStudioCode reports messages

As Freddy mentioned, this is all local to the script folder. So the settings file should be created in the .vscode/ subfolder within your script folder, and Typescript should be installed as a dev dependency of your script. This has to be done for every script folder unfortunately – there is no glob...
by samw
Wed Apr 15, 2026 11:25 am
Forum: Node.js scripting
Topic: VisualStudioCode reports messages
Replies: 6
Views: 516

Re: VisualStudioCode reports messages

In case anyone has trouble attempting the workaround in my previous reply, please note that the Typescript commands are only available in the VS Code Command Palette if a .ts file is open in the active tab.
by samw
Mon Apr 13, 2026 6:14 pm
Forum: Node.js scripting
Topic: getVariableAsString() returning undefined
Replies: 2
Views: 497

Re: getVariableAsString() returning undefined

Hi Dan, Thanks for bringing this to our attention. I just checked the implementation of Job.getVariableAsString() on the Switch side, and the method is simply returning the value coerced to a string, i.e: return String(value) This unfortunately means that if the value is undefined, you will get the ...
by samw
Mon Apr 13, 2026 5:48 pm
Forum: Node.js scripting
Topic: VisualStudioCode reports messages
Replies: 6
Views: 516

Re: VisualStudioCode reports messages

Hi Martin, This is not caused by the upgrade to Switch 25.11 but by a very recent VS Code update. VS Code now uses TypeScript 6.0 which requires ambient/global type definitions (such as the switch-scripting type definitions) to be explicitly included in tsconfig.json , and deprecates moduleResolutio...
by samw
Wed Feb 18, 2026 8:03 pm
Forum: Node.js scripting
Topic: Is there a REST API spec?
Replies: 1
Views: 3410

Re: Is there a REST API spec?

You might find something of use if you were to use the other link from the manuals page (the ZIP download): https://cdn-www.enfocus.com/manuals/DeveloperGuide/WebServices/24.1-zip/SwitchWebServicesRESTAPIDocumentation.zip This may contain something that can be re-purposed but it may not be ideal. Co...
by samw
Fri Feb 06, 2026 6:29 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 9479

Re: Debugging Strangeness

Hi Dan, I'm glad to hear that it's working for you – thanks for the confirmation. It's not the nicest of workarounds but I hope it helps for now. That is correct, you can remove the import and uninstall the module from your project once you are done debugging. You could even create a 'dummy' ES modu...
by samw
Fri Feb 06, 2026 5:40 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 9479

Re: Debugging Strangeness

Hi Dan, As Freddy mentioned, we are aware of this issue. It's already logged as a bug (internal ref ENFS-37977) and we will investigate and fix as soon as possible. My initial finding is that this is related to the bundling enhancement in 25.11 where we skip the unnecessary ESBuild process when no E...
by samw
Thu Feb 05, 2026 11:13 am
Forum: Node.js scripting
Topic: class PdfDocument in Switch 25.11
Replies: 7
Views: 9896

Re: class PdfDocument in Switch 25.11

Thank you Robert, I did not think to try that. For the enums, it is mentioned in the Node.js scripting manual that these require the EnfocusSwitch. prefix, for instance for global data Scope: Note: It is also available in global scope as EnfocusSwitch.Scope if you need to use it outside of main.js. ...
by samw
Thu Jan 29, 2026 12:28 pm
Forum: Flows
Topic: Route HTTP 500 Error
Replies: 2
Views: 4562

Re: Route HTTP 500 Error

We are aware that the behaviour deviates from the documentation here and this is logged as a bug (ENFSWAPP-4528). A fix is in the works which ensures that status codes 300-599 are routed to the error connection as per the app documentation. This will be included in the next release of the app. One o...
by samw
Wed Jan 14, 2026 12:57 pm
Forum: Node.js scripting
Topic: class PdfDocument in Switch 25.11
Replies: 7
Views: 9896

Re: class PdfDocument in Switch 25.11

Providing an update on this after some initial investigation. It appears there is an issue in 25.11 which means that classes and enums provided by the Switch scripting module cannot be accessed directly from within a CommonJS module, however ES modules are not affected . This has been logged as a bu...