11
Views
3
Comments
Solved
OutSystems JavaScript: Async Image Resize Returns 0-Byte Binary (Output Not Assigned)
Question
Application Type
Reactive

Hi everyone,
I’m trying to resize an image (Binary data) using a Client Action → JavaScript node.
The resizing works inside the JS code (I can see the correct Base64 in cleanBinary),
but OutSystems always returns an empty Binary (0 bytes) in the output parameter. 

2025-12-22 13-50-43
Sherif El-Habibi
Champion
Solution

Hello,

I guess the issue isn’t in the resizing logic it’s in the resolve call itself.

It should be written as $resolve() instead of resolve().

Also see this: 

Defining Asynchronous JavaScript Code

UserImage.jpg
Bitragunta Gnanarjun Reddy

Thanks for the clarification @Sherif El-Habibi — that actually helped me understand what was going wrong.

The issue wasn’t with the resize logic at all, it was with the way I handled the asynchronous part of the JavaScript. I originally assumed that returning my own Promise and calling resolve() would signal the end of the action, but OutSystems doesn’t use regular JavaScript promises inside a JS node.

What I learned is:

1.As soon as you call $resolve() or $reject(), OutSystems automatically wraps the JS in its own internal Promise.

2.Because of that, we shouldn’t create our own Promise or use the standard resolve() function.

3.OutSystems only waits for the asynchronous work (like image loading) if we call $resolve(), otherwise it finishes the action immediately and the outputs end up empty.

Once I replaced the manual promise logic and used $resolve() the way the documentation recommends, the Binary output started returning correctly instead of showing 0 bytes.

2025-12-22 13-50-43
Sherif El-Habibi
Champion
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.