Why did I get the following error while using intro.js in next my project?
ReferenceError: Element is not defined <br/>
Because intro.js uses the DOM API and on the SSR your document object model is not available.
You need to dynamically import intro.js into your project and disable ssr for it. Something like this should solve your problem:
// component with your intro.js logic
const Steps = dynamic(() => import('intro.js-react').then(mod => mod.Steps), {
ssr: false
});
const Hints = dynamic(() => import('intro.js-react').then(mod => mod.Hints), {
ssr: false
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With