You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Next App example for shows that users should be able to be initiate amplitude in the _app.js file using the following code: amplitude.init(AMPLITUDE_API_KEY);
Current Behavior
If you have pages that use the getServerSideProps function, calling amplitude.init() in the root file causes these pages to throw a 500 error when accessing them. I suspect this is because of an incompatibility with Server Side Rendering.
Steps to reproduce:
Add the init function call to _app.js file. amplitude.init(AMPLITUDE_API_KEY);
Create a page that uses the getServerSideProps function.
Run the Next.js development server and observe the behavior when navigating to the page from step 2.
Hi @vastava
Thanks for choosing amplitude.
Based on here, it says the page called getServerSideProps will be server side rendered at request time. However, our analytics-browser SDK only supports the client side. If you do not need to render the data during the request, then you should consider fetching data on the client side or getStaticProps.
Expected Behavior:
The Next App example for shows that users should be able to be initiate amplitude in the _app.js file using the following code:
amplitude.init(AMPLITUDE_API_KEY);
Current Behavior
If you have pages that use the
getServerSideProps
function, calling amplitude.init() in the root file causes these pages to throw a 500 error when accessing them. I suspect this is because of an incompatibility with Server Side Rendering.Steps to reproduce:
amplitude.init(AMPLITUDE_API_KEY);
Environment
The text was updated successfully, but these errors were encountered: