Custom app supported node modules

Good evening,

I was wondering if the node module “https” is supported.

I’m working on an integration between Freshservice and an old ticketing system, but when I try to do for example a GET request I recieve a “Certificare has expired” Error.
image

To avoid this error I need an Agent from the “https” module to pass in the call options.

new https.Agent({rejectUnauthorized: false})

But when I try to run the code this happens

In fact there isn’t a “index.js” file in the https folder, but this isn’t a problem with a regular Nodejs app.

I’m currently using axios to make api calls and in the Freshservice documentation it’s said

All popular npm packages (at least 50 downloads) are supported.

But I didn’t find a list of these 50+ supported npm packages.

Hello @Michele

Have you included the https npm in the manifest.json file for your app, as described in the “Dependencies” section here - Overview?

If you are using this npm - https://www.npmjs.com/package/https - it should be supported because it reports > 50 weekly downloads.

Hello @satwik ,

yes, I included the dependency in in the app manifest.

image

The package.json file looks the same as the one of the npm package that you linked

Maybe there’s something wrong in my project structure? I’m working with git, but when I generated the app I had an error telling me that the folder wasn’t empty (because of the initial “.git” and “README.md” files), so I created the “app” folder and generated the custom app inside there.

Hello @satwik , am I missing something? Or do you know someone that can help me with this issue?

Hello @Michele

Thanks for sharing the additional details.

To rule out any problems with the folder structure, it is recommended that you create the app using the fdk create command, referencing the appropriate template. In your case, the Your First Serverless App template should suffice. You should confirm that you can run this template app locally before copying your changes into this app and then trying to run it again.

If you still see the same error, can you please refer Freshworks CLI (FDK) now generates debug log file and share a verbose log file for the same?

Hello @satwik ,

the app was already built with the command that you suggested, but I made a new clean project for testing.
It worked locally until I added the module in question, just like the other project.
image
Here’s the log file
fdk.log (22.3 KB)

Thanks for trying this @Michele

I tried the same myself now and was able to reproduce the same problem. As you have pointed out, it happens to be something specific to the https package alone.

I have a feeling that the https://www.npmjs.com/package/https?activeTab=code package is broken because installing this package separately using npm install https results in a similar state - a package.json that points at an index.js file which is never installed.

Is it possible for you to consider an alternate dependency that achieves the same outcome?

1 Like

Hello @satwik ,

during my research I didn’t find any other way to get over the “Certificare has expired” Error. I guess the only way is to fix this certificate. Thanks for your assistance!

If you ask me other things I can’t reply until April 26th because tomorrow is holyday in my country.

Hi @Michele

When using node, one can use core modules (shipped default with node) and npm packages.

  1. For security reasons, Freshworks restricts some of the core modules where https is one of them.
  2. There also exists a https npm on the npm package library that is published 8 years. It is possible you are using it, and since it’s unmaintained is causing these certificate expiration problems for you.
  3. If you purpose of this module is to make API requests, you can try other modules such as superagent or anything in the npm library.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.