Open Nizoryu opened 2 weeks ago
Hi @Nizoryu, access to files outside of the collection path is not allowed in Bruno. When doing so you'll get an error message saying 'Error: Access to files outside of the collectionPath is not allowed'. I'm not sure why you are getting a 'Cannot find module' message. Can you check again and get back? Thanks! Also from the file structure you've shown, I assume 'demo' as your collection.
Related to #1397 and #795
Could you share your use case? Are you looking to share a common script file across multiple collections?
I have checked the following:
Describe the bug
I have no problem running my script from the root folder of the collection.
When I move the file to the parent folder like this:
i have this issue: Error invoking remote method 'send-http-request': VMError: Cannot find module '../script.js'
.bru file to reproduce the bug
meta { name: get demo type: http seq: 2 }
get { url: http://localhost:3000 body: none auth: none }
script:pre-request { const script = require("../script.js"); // const moment = require('moment');
console.log(bru.getVar('today')); }
Screenshots/Live demo link