N
N
Nikita2019-05-07 20:01:03
React
Nikita, 2019-05-07 20:01:03

How to fix 'Circular structure in "getInitialProps" result of page'?

Good evening, when I make a request to the API, I get the error 'Circular structure in "getInitialProps" result of page'
Code:

Profile.getInitialProps = async () => {
    const res = await axios.get('http://127.0.0.1:3030/api/v1/users/1');

    console.log(res);
    return {data: res}
}

Return JSON:
{"user_id":1,"username":"asd","address":"asdaasd","status":0,"balance":"0.14067736"}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2019-05-07
@0x452

I decided myself, changed axios to isomorphic-unfetch, everything worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question