DEV Community

loading...

NextJS throws error on navigating from the page that imports a script in the head tag

calebdeji profile image calebdeji Updated on ・1 min read

I have been facing an issue with NextJS. I tried to import a CDN script on a particular page. It works on the first load but then throws an error whenever I navigate to another page, thereby making it unusable when navigating to the initial page.

import React, { useState,

Discussion (0)

pic
Editor guide