Connecting Debugger to Node when Server Side Rendering #70

Closed
opened 2025-08-09 17:14:53 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @timothywisdom on 5/9/2018

This problem may be similar to https://github.com/aspnet/JavaScriptServices/issues/987 which has been closed for a year.

I am attempting to do Server Side Rendering from a React-Redux app. If the server renders a component that has to perform a fetch to get some async data, I get a:
TypeError: Converting circular structure to JSON
sent back to .Net Core.

I've reduced the fetch command to be as simple as possible:

import { addTask, fetch } from "domain-task";
....
fetchPromise = fetch("http://localhost:5000").then((response) => {
				console.log("REPSONSE", response);
			});
addTask(fetchPromise);

I've traced the problem down to the actual fetch command which uses isomorphic-fetch, which uses node-fetch (on the server), which uses Node's http.request method. Somehow this triggers readRequestBodyAsJson in entrypoint-http.js (I'm not sure how that part works yet) and this line is what's failing:
successValueJson = JSON.stringify(successValue);

Given that my originating fetch request is just using a URL (string), I can't understand what object is being stringified that causes a circular reference.

I am unable to debug the prerendering in Node because the project no longer spews debugging information or warnings to the console so I cannot see the needed
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
line.

Is the Is there another way to gleam the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx guid?
Does anyone know what could cause a circular reference in a domain-task fetch on the server?

*Originally created by @timothywisdom on 5/9/2018* This problem may be similar to https://github.com/aspnet/JavaScriptServices/issues/987 which has been closed for a year. I am attempting to do Server Side Rendering from a React-Redux app. If the server renders a component that has to perform a fetch to get some async data, I get a: `TypeError: Converting circular structure to JSON` sent back to .Net Core. I've reduced the fetch command to be as simple as possible: ``` import { addTask, fetch } from "domain-task"; .... fetchPromise = fetch("http://localhost:5000").then((response) => { console.log("REPSONSE", response); }); addTask(fetchPromise); ``` I've traced the problem down to the actual fetch command which uses isomorphic-fetch, which uses node-fetch (on the server), which uses Node's http.request method. Somehow this triggers readRequestBodyAsJson in [entrypoint-http.js](https://github.com/aspnet/JavaScriptServices/blob/78f7dccfabda674bf336ccbfc285ea1a68019e06/src/Microsoft.AspNetCore.NodeServices/Content/Node/entrypoint-http.js) (I'm not sure how that part works yet) and this [line ](https://github.com/aspnet/JavaScriptServices/blob/78f7dccfabda674bf336ccbfc285ea1a68019e06/src/Microsoft.AspNetCore.NodeServices/Content/Node/entrypoint-http.js#L79) is what's failing: successValueJson = JSON.stringify(successValue); Given that my originating fetch request is just using a URL (string), I can't understand what object is being stringified that causes a circular reference. I am unable to debug the prerendering in Node because the project no longer spews debugging information or warnings to the console so I cannot see the needed `chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` line. Is the Is there another way to gleam the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx guid? Does anyone know what could cause a circular reference in a domain-task fetch on the server?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#70
No description provided.