Dynamic Import of Neo4j in Nextjs

Hey,I am building an web-app with neo4j i am able to render the graph using direct import of neovis.js but it is causing issue in the build process as error 'self' reference not found but when i dynamically import it doesn't give any errors but the graph is not rendered
I am using nextjs