Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during server-render (ssr) #10638

Closed
CaptainN opened this issue Jul 18, 2019 · 2 comments
Closed

Error during server-render (ssr) #10638

CaptainN opened this issue Jul 18, 2019 · 2 comments

Comments

@CaptainN
Copy link
Collaborator

CaptainN commented Jul 18, 2019

As noted over in meteor/react-packages#251, I'm getting an error when rendering with React's renderToNodeStream if I try to query the mongo database (without withTracker or useTracker).

W20190718-15:50:38.257(-4)? (STDERR) events.js:183
W20190718-15:50:38.259(-4)? (STDERR)       throw er; // Unhandled 'error' event
W20190718-15:50:38.259(-4)? (STDERR)       ^
W20190718-15:50:38.271(-4)? (STDERR) 
W20190718-15:50:38.272(-4)? (STDERR) AssertionError [ERR_ASSERTION]: Cannot await without a Fiber
W20190718-15:50:38.274(-4)? (STDERR)     at awaitPromise (C:\Users\Kevin\AppData\Local\.meteor\packages\promise\0.11.2\npm\node_modules\meteor-promise\promise_server.js:75:12)
W20190718-15:50:38.276(-4)? (STDERR)     at Promise.await (C:\Users\Kevin\AppData\Local\.meteor\packages\promise\0.11.2\npm\node_modules\meteor-promise\promise_server.js:60:12)
W20190718-15:50:38.278(-4)? (STDERR)     at SynchronousCursor._nextObject (packages/mongo/mongo_driver.js:1091:12)
W20190718-15:50:38.292(-4)? (STDERR)     at SynchronousCursor.forEach (packages/mongo/mongo_driver.js:1105:22)
W20190718-15:50:38.293(-4)? (STDERR)     at SynchronousCursor.map (packages/mongo/mongo_driver.js:1115:10)
W20190718-15:50:38.294(-4)? (STDERR)     at SynchronousCursor.fetch (packages/mongo/mongo_driver.js:1139:17)
W20190718-15:50:38.310(-4)? (STDERR)     at Cursor.(anonymous function) [as fetch] (packages/mongo/mongo_driver.js:887:44)
W20190718-15:50:38.310(-4)? (STDERR)     at packages/npdev:collections/both.js:10:6
W20190718-15:50:38.312(-4)? (STDERR)     at packages/npdev:collections/server-connector.js:27:18
W20190718-15:50:38.332(-4)? (STDERR)     at Page (imports/ui/pages/Page.js:4:30)
W20190718-15:50:38.334(-4)? (STDERR)     at processChild (C:\Users\Kevin\repos\meteor-react-starter\node_modules\react-dom\cjs\react-dom-server.node.development.js:2888:14)
W20190718-15:50:38.335(-4)? (STDERR)     at resolve (C:\Users\Kevin\repos\meteor-react-starter\node_modules\react-dom\cjs\react-dom-server.node.development.js:2812:5)
W20190718-15:50:38.337(-4)? (STDERR)     at ReactDOMServerRenderer.render (C:\Users\Kevin\repos\meteor-react-starter\node_modules\react-dom\cjs\react-dom-server.node.development.js:3202:22)
W20190718-15:50:38.340(-4)? (STDERR)     at ReactDOMServerRenderer.read (C:\Users\Kevin\repos\meteor-react-starter\node_modules\react-dom\cjs\react-dom-server.node.development.js:3161:29)
W20190718-15:50:38.341(-4)? (STDERR)     at ReactMarkupReadableStream._read (C:\Users\Kevin\repos\meteor-react-starter\node_modules\react-dom\cjs\react-dom-server.node.development.js:3698:38)
W20190718-15:50:38.341(-4)? (STDERR)     at ReactMarkupReadableStream.Readable.read (_stream_readable.js:442:10)
W20190718-15:50:38.342(-4)? (STDERR)     at resume_ (_stream_readable.js:822:12)
W20190718-15:50:38.343(-4)? (STDERR)     at _combinedTickCallback (internal/process/next_tick.js:139:11)
W20190718-15:50:38.343(-4)? (STDERR)     at process._tickCallback (internal/process/next_tick.js:181:9)

Since I'm not using react-meteor-data at all, I think this is a problem in core or in server-render.

There is an example which triggers the error in the renderToNodeStream branch of CaptainN/meteor-react-starter. It uses npdev:collections behind the scenes, which does not use withTracker through react-meteor-data. It runs a mongo query synchronously with the react render cycle.

@stale
Copy link

stale bot commented Dec 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Dec 10, 2019
@stale
Copy link

stale bot commented Dec 18, 2019

This issue has been automatically closed it has not had recent activity.

@stale stale bot closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant