Requiring a lib module

Hey, guys!

How can I require a module inside a lib?
I’m doing it like this:

const OSLCResource = require("oslc-client/OSLCResource");

When I call fdk run, it works fine, I can use the module.
But when I call fdk validate or pack:

[ERROR] server\server.js::3: ‘oslc-client/OSLCResource’ is not listed in manifest.

Should I declare it on manifest? If so, how?
I’m finding this very strange, when I started using this lib, I remember calling fdk validate and this error was not happening.

manifest.json

{
  "platform-version": "2.0",
  "product": {
    "freshdesk": {}
  },
  "dependencies": {
    "oslc-client": "1.0.7",
    "rdflib": "2.1.3"
  }
}

Hi @samuelpares,

I tested it with the same library and the same dependency syntax. I’m not able to reproduce it in FDK version - 6.9.6. It successfully validated and packed the app without the error.

Could you share the FDK version and OS information?

@Raviraj, you talking about the OS info remembered me that I first tested this lib on Ubuntu, and now I’m using on Windows. I see now that’s why I said that I remember testing it before and it was working.

Working linux
Ubuntu 20.04.1 LTS
Node v10.18.1

Not working Windows
Windows [Version 10.0.19041.746]
Node v10.18.1

Although this seems a bug on Windows environment, when the time comes, I guess I can pack the app on Ubuntu.

@samuelpares Thanks for the information. I guess you forgot to add the FDK version along. I assume it’s the same latest FDK version. Could you confirm that?

If you still have access to the Ubuntu OS, please pack the application with it if it works. You can submit the app while we try to troubleshoot the issue with Windows OS. If any issues occur with Ubuntu as well, please report.

I will reproduce the issue in Windows to confirm and will let you know.

1 Like

Ah, yes… sorry:
FDK version in both OS:
6.9.6

Yes, I usually use Ubuntu, just in this particular project I’m developing on Window, because is easier to access some servers running local. But will pack it on Ubuntu, if anything happens, I’ll let you know.
Thank you.

1 Like