Hi fellow developers,
This topic is intended for anyone using Toolbox plugin v1.3.1 or earlier and using Server Script
If you’re using server-side actions in your app via Toolbox, the AWS deprecation of Node 14 for server-side actions will affect your app’s functionality. (Context from Bubble here).
Luckily, updating your app uses the same instructions that Bubble published for its plugin developers.
Tips for updating your server scripts:
- Turn on
Script is Async Function
to allow use ofawait
at top-level. - Ensure the script contains a return statement.
- To use
await
in your own functions, define them asasync function
.
Using app search tool, find every place where there are the following actions and replace with new syntax:
Function Name | Old API | New API |
---|---|---|
context.request | context.request | context.v3.request |
context.async | context.async | context.v3.async |
.get method on Bubble Things | .get method | .get method (returns promise) |
.get method on Bubble Lists | .get method | .get method (returns promise) |
.length method on Bubble Lists | .length method | .length method (returns promise) |
get_object_from_id | get_object_from_id | context.getThingById |
get_objects_from_ids | get_objects_from_ids | context.getThingsById |
Here’s an example of upgraded syntax, before:
var result = properties.thing1.get("title_text");
JSON.stringify(result);
and after:
var result = await properties.thing1.get("title_text");
return JSON.stringify(result);
If you add a post to this topic, myself or another community member will be able to assist.
Update guide: Updating to Plugin API v4 - Bubble Docs
More details on Toolbox docs
Thanks to Vivienne @ Bubble for the topic template