Search code examples
reactjsamp-htmlnext.js

amp pages stopped working at nextjs project, error at cdn.ampproject.org, resources cannot be loaded


I have an issue with AMP CDN. It has been integrated into Nextjs as I use the AMP feature in Nextjs itself, it was working fine yesterday but today the following error came up:

image of the error in console


Solution

  • This crash occurs when Next.js cannot load cdn.ampproject.org. For solving this problem first Check the network connection then you must necessarily restart the next.js server or dev server.

    npm run dev
    

    or

    npm run start