Script require failed when running main.js

Enonic version: Enonic XP 7.7.3
OS: Pop!_OS 20.04 LTS

I’m having some errors when starting my application:
In my main.js file src/main/resources/main.js, I import some of Enonic’s libs, such as http-client, context, content, and task. But then I get the following error messages:

java.util.concurrent.CompletionException: com.enonic.xp.resource.ResourceProblemException: Script require failed: [myProjectName:/lib/http-client.js]

Even though my build.gradle includes http-client as a dependency.

Can you share more code? How do you include dependencies in build.gradle? How do you require them in your code?