Are the libs available from main.js?

I am looking into the repo-lib from 6.9.0, which I know is currently not released yet. Specifically, I am trying to call it from the main.js-file, which I understand is also new?

However, I get an error saying that the lib does not exist. I get the same error when calling a few others, like the portal or task libs. The content lib gives an error that key is missing, which is to be expected, since main.js is not connected to a site.

I am trying to invoke the lib with the following code:
var repoLib = require('/lib/xp/repo');

The error message seems to indicate that only libs in the same app are looked up:
com.enonic.xp.resource.ResourceProblemException: Resource [] was not found.

Am I doing something wrong? What, if any, libs are available from the main.js file?

Did you remember to include the libraries in your build.gradle file?

Well… this is embarrassing… I actually somehow managed to comment out the dependency. :unamused:

1 Like