usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.56k stars 1.27k forks source link

Error invoking remote method 'send-http-request': VMError: Cannot find module '@faker-js/faker' #3480

Open ashameem123 opened 1 week ago

ashameem123 commented 1 week ago

I have checked the following:

Describe the bug

How to use faker for generating random data in our request??

Using this guide to insatll and use faker library:

https://docs.usebruno.com/scripting/external-libraries

.bru file to reproduce the bug

NA

Screenshots/Live demo link

NA

cyrilgeorge153 commented 1 week ago

@ashameem123 Can I know which Javascript sandbox mode you are using. If you are using safe mode you will get this error. If that's the case switch to developer mode and check again.

ashameem123 commented 1 week ago

@ashameem123 Can I know which Javascript sandbox mode you are using. If you are using safe mode you will get this error. If that's the case switch to developer mode and check again.

I am using Developer mode.

ashameem123 commented 6 days ago

@sreelakshmi-bruno - Any help is greatly appreciated.

sreelakshmi-bruno commented 3 days ago

Hi @ashameem123 , I tried faker for generating random data using the guide in the docs and it works fine for me. Can you share the collection if possible for me to test it out?

sreelakshmi-bruno commented 2 days ago

See here

Screenshot 2024-11-19 at 2 28 30 PM
ashameem123 commented 2 days ago

@sreelakshmi-bruno - Could you please also share the package.json for me to compare?

sreelakshmi-bruno commented 1 day ago

Sure, here you go: package.json

ashameem123 commented 1 day ago

@sreelakshmi-bruno Thanks for sharing the file. It's weird that I have the same exact steps but it won't work for me. Is it possible for you to generate RandomUrl in the example you provided above and check if you could generate it?

I can generate uuid with below code, const uuid = require("uuid"); bru.setVar('id', uuid.v4()); But nothing is working for me to generate random url , name etc

This is my folder structure,

image