terminusdb-client-js icon indicating copy to clipboard operation
terminusdb-client-js copied to clipboard

Regression after upgrade of Axios v0.27.1 to v1.6

Open hoijnet opened this issue 7 months ago • 0 comments

Describe the bug The axios library upgrade caused a regression where CSV formData could no longer be processed correctly in Node.JS, with an error thrown.

To Reproduce Run a WOQL query in the javascript client that uploads a CSV file:

const result = await client.query(
        WOQL.and(
            WOQL.get(
                WOQL.as('Name', 'v:Name')
                    .as('Manager', 'v:Manager')
                    .as('Title', 'v:Title')
            ).post("Employees.csv"),
        )
    )

Expected behavior Return correct bindings.

Error logs

Error: API Error api:message Type error for null which should be dict api:status api:failure Code: 400 url: http://localhost:6363/api/woql/admin/GettingStartedDB/local/branch/main at Object.apiErrorFormatted (/home/hoijnet/code/dfrnt/terminusdb-client-js/lib/errorMessage.js:95:13) at /home/hoijnet/code/dfrnt/terminusdb-client-js/lib/dispatchRequest.js:227:30 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async runQuery (/home/hoijnet/code/dfrnt/tuscli/examples/woql/content/emp.js:30:20) { data: { 'api:message': 'Type error for null which should be dict', 'api:status': 'api:failure', 'system:witnesses': [ { '@type': 'vio:ViolationWithDatatypeObject', 'vio:literal': null, 'vio:message': 'Type error for null which should be dict', 'vio:type': 'dict' } ] }, status: 400 }

System information (please complete the following information):

  • OS: Ubuntu
  • NodeJS 18
  • terminus-client 10.0.33

hoijnet avatar Jul 20 '24 12:07 hoijnet