Search found 34 matches

by DtM
Mon Feb 09, 2026 4:03 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

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 mod...
by DtM
Fri Feb 06, 2026 6:01 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

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 ...
by DtM
Fri Feb 06, 2026 5:04 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

Re: Debugging Strangeness

freddyp wrote: Fri Feb 06, 2026 4:42 pm I can reproduce the problem and apparently this has been logged before.
Hi Freddy,

At least that is reassuring that it isn't an issue with our environment.

Is there a knowledge base article or something similar that explains how I can work around the issue in the meantime?
by DtM
Fri Feb 06, 2026 4:30 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

Re: Debugging Strangeness

Now that I've made a TypeScript version of my test file, I get different behavior, but it is still not as you would expect. When I attach this version, I get the SwitchScriptExecutor.js as normal, upon clicking continue, the script displays line 611 of the NodeScriptExecutor.js file. Again, this is ...
by DtM
Fri Feb 06, 2026 4:15 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

Re: Debugging Strangeness

The fact that there is an outMain.js means that Switch has had to do some processing on the file to make it work in a CommonJS environment. Does your script use ES Modules? Are you debugging a script folder or a packed script? Adding breakpoints to the outMain.js should work, or doesn't it? It is n...
by DtM
Fri Feb 06, 2026 11:39 am
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

Re: Debugging Strangeness

Just wanted to give an update that I've tried setting up a brand new Script with the SwitchScriptTool.

I tried it with both a simple jobArrived and timerFired function, both suffer from the same issue.

I'm completely stumped as to what is causing this!
by DtM
Thu Feb 05, 2026 5:27 pm
Forum: Node.js scripting
Topic: Debugging Strangeness
Replies: 10
Views: 741

Debugging Strangeness

Hello everyone, I've been running into some strangeness when trying to debug a new script. I am on Switch 25.11, running Visual Studio Code Version: 1.108.1. When I attach the debugger to my script, I get taken to the NodeScriptExecutor.js script as you would expect. Upon pressing the Continue butto...
by DtM
Thu Apr 11, 2024 12:35 pm
Forum: Node.js scripting
Topic: Module Import For Script Expressions
Replies: 1
Views: 16975

Module Import For Script Expressions

Hello, Like many others, we're looking at replacing all of our legacy Script Expressions with new, Node.JS Script Expressions. I have a question regarding Module Imports. The placeholder of new Script Expressions has the comment of // Your imports here Does this apply to only built in modules (path,...
by DtM
Mon May 15, 2023 2:31 pm
Forum: Node.js scripting
Topic: Unresolved Promises
Replies: 5
Views: 12851

Re: Unresolved Promises

Also it's worth noting that the file names won't always fit this example pattern - they could be anything.
by DtM
Mon May 15, 2023 2:26 pm
Forum: Node.js scripting
Topic: Unresolved Promises
Replies: 5
Views: 12851

Re: Unresolved Promises

Apart from the unresolved promise issue, what is missing in "Sort files in job" to accomplish what you need? Hi Freddy, I need the files to be returned using a "natural" sort. I.E if I have 10 files named File 1.pdf through File 10.pdf, I want them to be listed alphabetically an...
by DtM
Mon May 15, 2023 2:10 pm
Forum: Node.js scripting
Topic: Unresolved Promises
Replies: 5
Views: 12851

Re: Unresolved Promises

Hi Matthew,

Thank you for the quick response - that was indeed the issue.

Can't believe I missed that - definite case of snow blindness!

Thanks again,

Dan
by DtM
Mon May 15, 2023 12:32 pm
Forum: Node.js scripting
Topic: Unresolved Promises
Replies: 5
Views: 12851

Unresolved Promises

Hello, I'm trying to write a script which should sort files in a folder in a particular way. import fs from "fs"; import path from "path"; import tmp from 'tmp-promise'; function naturalSort(arr: String[]){ return arr.map(v => { let processedName = []; let str = v; for(let i = 0;...
by DtM
Tue Mar 07, 2023 5:42 pm
Forum: Flows
Topic: Keep job in Job Board while job is processing in external software?
Replies: 11
Views: 16361

Re: Keep job in Job Board while job is processing in external software?

The unique identifier isn’t stripped the issue is that the unique identifiers differs between the files that sent to Apogee with Archive hierachy and the file placed in the Generic application folder. I will try the temp file solution. I need to put it in a folder thats not the last folder in a flo...
by DtM
Fri Feb 03, 2023 3:33 pm
Forum: Node.js scripting
Topic: TypeScript Cannot Find Names
Replies: 1
Views: 10252

TypeScript Cannot Find Names

Hello, I've just tried making my first TypeScript file since having Switch Spring 2022. I used the follow SwitchScriptTool command to make the folder: "C:\Program Files\Enfocus\Enfocus Switch\SwitchScriptTool\SwitchScriptTool.exe" --create "SendOrdersToPrinter" .\ After opening m...
by DtM
Thu Sep 16, 2021 2:30 pm
Forum: Node.js scripting
Topic: Cannot Make New Job From Empty Folder
Replies: 4
Views: 15103

Re: Cannot Make New Job From Empty Folder

Hi Freddy, Apologies, my mistake for not clarifying - I am using tmp-promise which as the name would suggest is a wrapper for tmp that adds async await functionality. Another thing that this wrapper does, is change the .name variable to .path (this also caught me off guard the first time I installed...