"TypeError: Converting circular structure to JSON" with GET request

Pepe

I get this error when I try a GET request on "/strutture" trough Insomnia:

TypeError: Converting circular structure to JSON

Here's the repo (inside the server folder I'm getting the error, I still need to merge it with the React app). I noticed when doing the migration, no ".db3" file got created.

Sihan Tawsik

You can just use promise fulfilment to get the results.

server.get('/strutture', async (req, res) => {
    //GET STRUTTURE
    try{
        const strutture = await db("structure");
        res.json(strutture);
    } catch(err){
        console.log(err);
    }
})

This will return the correct query results

query result of knex

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

"TypeError: Converting circular structure to JSON" with GET request

TypeError: Converting circular structure to JSON when trying to POST request

Sequelize: TypeError: Converting circular structure to JSON

GraphCool TypeError: Converting circular structure to JSON

Elliptic : TypeError : Converting circular structure to JSON

Axios TypeError: Converting circular structure to JSON

Angular - TypeError: Converting circular structure to JSON

TypeError: Converting circular structure to JSON in nodejs

avoiding TypeError: Converting circular structure to JSON

Reading fixture is throwing error TypeError: Converting circular structure to JSON

how to solve (Uncaught TypeError: Converting circular structure to JSON)

Moving code to an exported function results in TypeError: Converting circular structure to JSON

[Vue warn]: Error in render: "TypeError: Converting circular structure to JSON

Express Middleware: ERROR: TypeError: Converting circular structure to JSON

TypeError: Converting circular structure to JSON in retrieving html string from mongodb

Firestore references create a "TypeError: Converting circular structure to JSON"

TypeError: Converting circular structure to JSON - find error in json

Chrome sendrequest error: TypeError: Converting circular structure to JSON

TypeError: Converting circular structure to JSON property 'name' closes the circle

TypeError: Converting circular structure to JSON with StorybookJS on React Native

Doing a proper MongoDB Query (TypeError: Converting circular structure to JSON)

VM1374:32 Uncaught TypeError: Converting circular structure to JSON(…)

ERROR TypeError: Converting circular structure to JSON --> starting at object with constructor 'FormGroup'

TypeError converting circular structure to json at JSON.stringify (<anonymous>)

Amazon Cognito confirmPassword fails with (TypeError: Converting circular structure to JSON)

TypeError: Converting circular structure to JSON --> starting at object with constructor 'ClientRequest'

Uncaught TypeError: Converting circular structure to JSON after Angular / dependencies update

How do I solve "TypeError: Converting circular structure to JSON" in NodeJS

TypeError: Converting circular structure to JSON -- Next.js