facebook / facebook/relay

Converting circular structure to JSON on QueryRenderer

Open
#2,872 2 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Yesterday I've upgraded my `react-relay` and `relay-compiler` to 6.0.0. I've cleared all `__generated__` directories, rebuilt my `schema.graphql` structure start over.

Since then I was unable to load my application that has been working for months. The error I'm getting:
![lixo](https://user-images.githubusercontent.com/10373990/65725993-5d7b9680-e08a-11e9-968a-f02f059ea58b.png)

And the following dump on console:

`The above error occurred in the component:
in ReactRelayQueryRenderer (at AppQueryRenderer.js:47)
in AppQueryRenderer (created by Route)
in Route (created by withRouter(AppQueryRenderer))
in withRouter(AppQueryRenderer) (at AppContextLoader.js:121)
in AppContextLoader (at AppBootstrap.js:54)
in AppBootstrap (at App.js:64)
in NavComponent (created by Route)
in Route (at App.js:81)
in Switch (at App.js:77)
in Router (created by BrowserRouter)
in BrowserRouter (at App.js:98)
in App (at src/index.js:32)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
__stack_frame_overlay_proxy_console__ @ :3000/static/js/bundle.js:59926
:3000/static/js/bundle.js:55174 Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'Provider' -> object with constructor 'Object'
--- property '_context' closes the circle
at Object.stringify ()
at getRequestCacheKey (:3000/static/js/bundle.js:65893)
at new ReactRelayQueryRenderer (:3000/static/js/bundle.js:65704)
at constructClassInstance (:3000/static/js/bundle.js:45778)
at updateClassComponent (:3000/static/js/bundle.js:49455)
at beginWork$1 (:3000/static/js/bundle.js:50975)
at HTMLUnknownElement.callCallback (:3000/static/js/bundle.js:32817)
at Object.invokeGuardedCallbackDev (:3000/static/js/bundle.js:32867)
at invokeGuardedCallback (:3000/static/js/bundle.js:32924)
at beginWork$$1 (:3000/static/js/bundle.js:55687)
at performUnitOfWork (:3000/static/js/bundle.js:54681)
at workLoopSync (:3000/static/js/bundle.js:54655)
at renderRoot (:3000/static/js/bundle.js:54348)
at scheduleUpdateOnFiber (:3000/static/js/bundle.js:53889)
at scheduleRootUpdate (:3000/static/js/bundle.js:56789)
at updateContainerAtExpirationTime (:3000/static/js/bundle.js:56817)
at updateContainer (:3000/static/js/bundle.js:56906)
at :3000/static/js/bundle.js:57433
at unbatchedUpdates (:3000/static/js/bundle.js:54157)
at legacyRenderSubtreeIntoContainer (:3000/static/js/bundle.js:57432)
at Object.render (:3000/static/js/bundle.js:57512)
at Object../src/index.js (:3000/static/js/bundle.js:201134)
at __webpack_require__ (:3000/static/js/bundle.js:679)
at fn (:3000/static/js/bundle.js:89)
at Object.0 (:3000/static/js/bundle.js:202110)
at __webpack_require__ (:3000/static/js/bundle.js:679)
at :3000/static/js/bundle.js:725
at :3000/static/js/bundle.js:728
:3000/static/js/bundle.js:32321 ./src/routes/router.js`

My `QueryRenderer`:

`
class AppQueryRenderer extends Component {
static propTypes = {
onContent: PropTypes.func,
query: PropTypes.func,
variables: PropTypes.object
};

getContent = props => {
if (this.props.onContent) return this.props.onContent(props);
else throw new Error("ERROR(AppQueryRenderer): No content to handle.");
};

render() {
return (
{
if (error) {
let unauthorizedText = "Error401:Unauthorized";

if (error.message.search(unauthorizedText) !== -1) {
return null;
}
else
// If another error show in message bar
return (

);
} else if (props) {
return this.getContent(props);
}

return ;
}}
/>
);
}
}

export default withRouter(AppQueryRenderer);`

I'm running on MacOs Mojave, Chrome version 77.0.3865.90

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.