Error: Subscriptions are not supported for Server-Side Rendering (SSR)
See original GitHub issueuseEffect(()=>{
const subscription = API.graphql(
graphqlOperation(subscriptions.onCreateTodo)
).subscribe({
next: (todoData) => console.log(todoData)
});
},[]);
Why do subscriptions not work in the mounted hook?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Server-side rendering - Apollo GraphQL Docs
Server -side rendering (SSR) is a performance optimization for modern web apps. It enables you to render your app's initial state to raw...
Read more >Deploy server-side rendered apps with Amplify Hosting
Describes AWS Amplify deployment and hosting support for apps with server-side rendering (SSR).
Read more >Angular5 Server side rendering, external Api data service ...
And there is no error in SSR mode. I made an another api server and it makes logs whenever the function is called....
Read more >Server-Side Rendering - tRPC
When you enable SSR, tRPC will use getInitialProps to prefetch all queries on the server. This results in problems like this when you...
Read more >[SSR] setTimeout is not supported in server-rendered Javascript
Make sure you have everything setup correctly... client side code separate from server side code. https://reactjs.net/bundling/webpack.html Or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mellymelon You’re absolutely right. This is a bug from:
https://github.com/aws-amplify/amplify-js/pull/6937
We need both
isNode
andssr
checks.We’ll get this fixed for you!
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.