Closed detailswes closed 1 year ago
Hi @detailswes, to use amplitude-js
in Next.js, you'll have to make sure that logEvent
call is only invoked in the browser environment, and not in the node environment. The node environment does not support XMLHttpRequest
, which is the default http client that amplitude-js
uses.
version : "amplitude-js": "^8.21.1", while starting app I am getting [Amplitude] amplitude-js will not work in a non-browser environment. If you are planning to add Amplitude to a node environment, please use @amplitude/node.
I am using next js please tell me the solution