Florent, What is your modules root in your app server configuration? Do you have a '/lib' at the end?
The import rules are the same in both XQuery and JavaScript <http://docs.marklogic.com/guide/app-dev/import_modules#id_29407>. 1. When an import/invoke/spawn path starts with a leading slash, first look under the Modules directory 2. If the import/invoke/spawn path starts with a slash, and it is not found under the Modules directory, then start at the App Server root. 3. If the import/invoke/spawn path does not start with a slash, first look under the Modules directory. If the module is not found there, then look relative to the location of the module that called the function. Please work through support <[email protected]> to file a bug if the behavior you’re seeing doesn’t adhere to the above rules. Justin > On Apr 28, 2016, at 3:20 AM, Florent Georges <[email protected]> wrote: > > Hi Geert, > > Thank you for this. Got any response? > > -- > Florent Georges > http://fgeorges.org/ > http://h2oconsulting.be/ > > > On 5 April 2016 at 11:27, Geert Josten wrote: >> I forwarded your message internally.. >> >> Cheers, >> Geert >> >> On 4/5/16, 11:08 AM, "[email protected] on behalf of >> Florent Georges" <[email protected] on behalf of >> [email protected]> wrote: >> >>> Just tried 8-0.5, still the same behaviour. I don't have access to >>> Discuss, I will try to find whether there is a better way to report it >>> if Developer Discussion is not well suited. >>> >>> Regards, >>> >>> -- >>> Florent Georges >>> http://fgeorges.org/ >>> http://h2oconsulting.be/ >>> >>> >>> On 5 April 2016 at 10:50, Geert Josten wrote: >>>> Try with 8.0-5, and if it fails on that version as well, mail discuss or >>>> file a bug.. >>>> >>>> Cheers >>>> >>>> On 4/5/16, 10:45 AM, "[email protected] on behalf >>>> of >>>> Florent Georges" <[email protected] on behalf of >>>> [email protected]> wrote: >>>> >>>>> Hi Geert, >>>>> >>>>> No, it's imported from the dir within which lib/ is. >>>>> >>>>> Given the different error messages, it seems there is something wrong >>>>> with the resolution. The following examples (if passed to require() >>>>> in the code below) resolve to (from the error message): >>>>> >>>>> - "lib/docs.xqy" -> "lib/lib/docs.xqy" >>>>> - "./lib/docs.xqy" -> "./lib/lib/docs.xqy" >>>>> - "docs.xqy" -> "docs.xqy" >>>>> - "./docs.xqy" -> "./docs.xqy" >>>>> >>>>> Regards, >>>>> >>>>> -- >>>>> Florent Georges >>>>> http://fgeorges.org/ >>>>> http://h2oconsulting.be/ >>>>> >>>>> >>>>> On 5 April 2016 at 10:31, Geert Josten wrote: >>>>>> Are you invoking the require from code running at lib/ itself? Maybe >>>>>> you >>>>>> meant to require /lib/docs.xqy instead? >>>>>> >>>>>> Cheers, >>>>>> Geert >>>>>> >>>>>> On 4/5/16, 10:28 AM, "[email protected] on >>>>>> behalf >>>>>> of >>>>>> Florent Georges" <[email protected] on behalf of >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> In JavaScript, I have a module importing (trying to import) an XQuery >>>>>>> module: >>>>>>> >>>>>>> var d = require('lib/docs.xqy'); >>>>>>> >>>>>>> But that throws the error: "XDMP-MODNOTFOUND: var d = >>>>>>> require('lib/docs.xqy'); -- Module lib/lib/docs.xqy not found". >>>>>>> >>>>>>> See the "lib/lib/docs.xqy"? (with double "lib/") >>>>>>> >>>>>>> If I change it to "require('docs.xqy')", it complains (correctly) that >>>>>>> "Module docs.xqy not found". >>>>>>> >>>>>>> Did I miss anything? >>>>>>> >>>>>>> Regards, >>>>>>> >>>>>>> -- >>>>>>> Florent Georges >>>>>>> http://fgeorges.org/ >>>>>>> http://h2oconsulting.be/ >>>>>>> _______________________________________________ >>>>>>> General mailing list >>>>>>> [email protected] >>>>>>> Manage your subscription at: >>>>>>> http://developer.marklogic.com/mailman/listinfo/general >>>>>> >>>>>> _______________________________________________ >>>>>> General mailing list >>>>>> [email protected] >>>>>> Manage your subscription at: >>>>>> http://developer.marklogic.com/mailman/listinfo/general >>>>> _______________________________________________ >>>>> General mailing list >>>>> [email protected] >>>>> Manage your subscription at: >>>>> http://developer.marklogic.com/mailman/listinfo/general >>>> >>>> _______________________________________________ >>>> General mailing list >>>> [email protected] >>>> Manage your subscription at: >>>> http://developer.marklogic.com/mailman/listinfo/general >>> _______________________________________________ >>> General mailing list >>> [email protected] >>> Manage your subscription at: >>> http://developer.marklogic.com/mailman/listinfo/general >> >> _______________________________________________ >> General mailing list >> [email protected] >> Manage your subscription at: >> http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
