question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Converting circular structure to JSON

See original GitHub issue

Hello everybody.

I’m trying to duplicate my actual production environment to create dev environment in same server. I already duplicate database and nginx configuration for another domain, but, when I access my dev environment I got the following error:

Debug: internal, implementation, error TypeError: Uncaught error: Converting circular structure to JSON at Object.stringify (native) at Object.internals.paths.build.internals.paths.buildRoutes.internals.hasFileType (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi-swagger/lib/paths.js:381:28) at /var/www/dev-api.mydomain.com.br/public/node_modules/hapi-swagger/lib/paths.js:223:23 at Array.forEach (native) at internals.paths.build.internals.paths.buildRoutes.routes [as buildRoutes] (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi-swagger/lib/paths.js:179:12) at internals.paths.build.routes.forEach [as build] (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi-swagger/lib/paths.js:151:17) at Object.builder.getSwaggerJSON (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi-swagger/lib/builder.js:110:26) at settings.log.plugin.route.config.handler.plugin.methods.getSwaggerJSON.Builder.getSwaggerJSON (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi-swagger/lib/index.js:115:29) at Object.exports.execute.internals.prerequisites.internals.handler.finalize [as handler] (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi/lib/handler.js:101:51) at /var/www/dev-api.mydomain.com.br/public/node_modules/hapi/lib/handler.js:32:23 at internals.Protect.run.finish [as run] (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi/lib/protect.js:60:12) at exports.execute.finalize (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi/lib/handler.js:26:22) at each (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi/lib/request.js:401:16) at iterate (/var/www/dev-api.mydomain.com.br/public/node_modules/items/lib/index.js:36:13) at done (/var/www/dev-api.mydomain.com.br/public/node_modules/items/lib/index.js:28:25) at module.exports.internals.state.next (/var/www/dev-api.mydomain.com.br/public/node_modules/hapi/lib/route.js:292:16)

My production environment is working. Anyone can help-me with this?

(I have replaced the url of my domain to dev-api.mydomain.com.br for obvious reasons)

Thanks 😃

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JKHeadleycommented, Oct 17, 2017

Hi @murilo-campaner, not sure if this is a rest-hapi specific issue, but I remember running into something similar earlier that was related to hapi-swagger. Updating to the latest version of hapi-swagger fixed the issue. If you use rest-hapi v0.27.3 and higher it uses an updated version of hapi-swagger that might help.

0reactions
JKHeadleycommented, Nov 8, 2017

@rahil471 I have not set up a project directly using Nginx, however, the project I mentioned above uses Cloudflare to redirect to rest-hapi, and I believe they use Nginx for reverse-proxying.

I will continue to look into this issue, but for now I suggest posting the issue on the hapi-swagger page or browsing their issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is TypeError: Converting circular structure to JSON?
TypeError: Converting circular structure to JSON occurs when you try to reference your variable name within the JSON object.
Read more >
TypeError: Converting circular structure to JSON - Stack ...
TypeError: Converting circular structure to JSON. It seems that I can get the object logged to the console by using just plain: console.log(object)....
Read more >
Converting Circular Structure to JSON - Career Karma
On Career Karma, learn about the restrictions of JSON in the debugging tutorial for converting circular structure to json.
Read more >
TypeError: Converting circular structure to JSON in JS
The "Converting circular structure to JSON" error occurs when we pass an object that contains circular references to the JSON.stringify() method.
Read more >
How to fix TypeError: Converting circular structure to JSON in ...
To fix this error, you need to make sure that your objects don't contain circular references. One way to do this is to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found