Server Side Plugin, Node Js Module Missing

Hi Guys,

I’m trying develop a plugin to connect and query in the Bubble apps from the SAP Haha Database, because the SQL Database Connector doesn’t work to this database type.

My plugin has a server-side action where I pass all credentials data for connection, in the action code I require the Module @sap/hanaclient for use, and also I checked the option ‘Use Node JS Modules’, this option creates the import of this Module as Dependencies, however when we try run the action the app show a message that this Module is Not available, my doubt is: Anyone already installed a New Module at server-side using command line at terminal or by Other way,?

Are you asking about declaring the required module? When importing a package such as AWS-SDK, it’s necessary to include the node module in your project and declare it within your codebase.

For instance, your Node Modules file should list the module as a dependency, like so:

    "dependencies": {
        "@aws-sdk/client-s3": "latest"

Additionally, you need to import the specific components from the package in your code to utilize them. Something like:
const { S3Client, ListObjectsCommand } = require('@aws-sdk/client-s3');

1 Like

You probably have a typo in the name of the module, it should be @sap/hana-client.

It looks like this package comes with prebuilt native dependencies so probably the environment where the function runs is not supported by the library.
You should ask bubble’s support to see if that’s the case.

Hi @newhorizoncode , thanks for your reply.
Yes I’m declaring this Module in the depencies, then I cliked in the green link to generate a new pacakage.json file, and in the begin of my code I created a variant requiring the module like your example:
Action code:
Const Hana = require ("*sap/hanaclient");

In the Space for Package.json
“dependencies”: {
“*sap/hanaclient” : “lasted”
So, I’m following all steps for use an action server-side.

@dorilama, thanks for your reply. Exactly this Module is not installed in the bubble server instance. I already open a support ticket, the answer was:

"We’re limited in our support when it comes to building plugins, however, I’d like to point you to some resources. Here is our documentation for using node modules in server side actions.

In addition, getting help with loading modules is a great question for our forum. Our community is incredibly vibrant, and many expert Bubble users spend time on the forum, helping other users out. The best way to get help from the community is by posting your question with as much context and supporting details as possible. In particular, this forum post might be helpful.

I sincerely apologize for the limited action I’m able to take here, but I hope this helps - please don’t hesitate to reach out if you have any other questions/concerns and our team would be happy to assist where we can."

  1. The module is actually called @sap/hana-client
  2. I think that the prebuilt native executables that this module installs do not support the environment where the plugin code is executed. My suggestion is to use another backend to run this code and expose an api to connect it to bubble.
1 Like

@dorilama, Yes the Module is @sap/hana-client, I used * instead @ only here, because the forum was considering as mention.

I found JS backend called Runkit, there, i can simulate a JS server direct in the browser however this works only embeded in a HTML frame, and I need use like a backend Workflow.