Skip to content

Cannot find module error when trying to use script files in Post Response #4149

@hadarnexus

Description

@hadarnexus

I have checked the following:

  • I have searched existing issues and found nothing related to my issue.

This bug is:

  • making Bruno unusable for me
  • slowing me down but I'm able to continue working
  • annoying

Bruno version

1.39.1

Operating System

Windows

Describe the bug

Added scripts to addtionalContextRoots in the bruno.json file

"additionalContextRoots": [ "../scripts" ],

Imported the the script in Script - Post Response

const myScriptFile = require('../scripts/my_script_file')

Ran the request and observed the following error

Error invoking remote method 'send-http-request': VMError: Cannot find module '../scripts/my_script_file'

Note that this file works fine when added to Script - Pre Request

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions