Closed Enigma10 closed 2 years ago
I'm not sure what your issue is. If you don't have amplitude on the server side then it doesn't make sense to use this.
I am also getting this error. I think the issue is Next.js compiles components' code for a "server" pass through and then again for client; and client-specific libraries expect window
. I get this error:
Server Error
ReferenceError: window is not defined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
[REDACTED]/node_modules/amplitude-js/amplitude.umd.js (1197:12)
I found a StackOverflow thread that discusses solutions and work arounds.
I am getting a warning that the amplitude instance is required. But it will be always
undefined
for server ride rendering.