usebruno / bruno

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

Error invoking remote method 'send-http-request': TypeError: 'set' on proxy: trap returned falsish for property '_dbObjectClasses' #1711

Open Doudourino opened 6 months ago

Doudourino commented 6 months ago

Bruno 1.9.0. I'm trying to use oracledb Thin connection to make an SQL statement in a post-request script without luck.

I have this error message :

Error invoking remote method 'send-http-request': TypeError: 'set' on proxy: trap returned falsish for property '_dbObjectClasses'

The script is working fine using NodeJS, but not inside Bruno application :

const oracledb = require('oracledb');
console.log("Connection to Oracle Database ...");
const connection = await oracledb.getConnection({
    user          : "test",
    password      : "pwd",
    connectString : "10.13.0.1/ex"
});
console.log('Succeed connected.', connection );
await connection .close();

Here is the connection objet from working execution with Node :

 Connection {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  _dbObjectClasses: Map(0) {},
  _closing: false,
  _impl: ThinConnectionImpl {
    _inProgress: false,
    _dbObjectTypes: Map(0) {},
[...]

The property _dbObjectClasses in Bruno's error message is part of this object.

My bruno.json is as follow :

  "scripts": {
    "moduleWhitelist": ["form-data", "handlebars", "oracledb", "buffer", "events", "proxy","crypto", "dns","os","readline","net","process","timers","tls"],
    "filesystemAccess": {
      "allow": true
    }
  }

Proxy is disabled in preferences.

What am I missing here ?

Estegar commented 5 months ago

I'm experiencing the exact same issue, but with PostgreSQL. The configuration I have works fine with any other JavaScript framework except when using Bruno. I want to incorporate Bruno into my projects, but this issue is preventing me from doing so. Some of my tests require database changes before they can begin.

Carsten87 commented 5 months ago

I have the same issue with tar. Trying to send the request fails with Error invoking remote method 'send-http-request': TypeError: 'set' on proxy: trap returned falsish for property 'Symbol(flowing)'. I would like to tar some files before uploading them.

const tar = require('tar');
const fs = require('fs');
const path = require('path');

const attachmentFilename = "my.tar.gz";
const attachmentPath = path.join(bru.cwd(), attachmentFilename);

// This is where it fails
tar.create({
    gzip: true,
    file: attachmentPath,
},
['myfile.txt']);

/*
const attachment = fs.readFileSync(attachmentPath);
const attachmentLength = attachment.length;

req.setHeader("Content-Length", attachmentLength);
req.setBody(attachment);
*/
Estegar commented 5 months ago

Any progress with this issue? Maybe someone have a workaround for this? As of now i'm firing some Python scripts before tests, but i cannot run those inbetween Bruno tests so it is limited solution.