javascript-shinobis / nike-clone-app

An E-commerce Nike Store clone web application made using NextJs, Tailwind CSS and Strapi
2 stars 3 forks source link

Bug | Unhandled Runtime Error #17

Open vdwaseem opened 1 year ago

vdwaseem commented 1 year ago

Short detail:

I cloned the repository first time and started development server then I faced this Unhandled Runtime Error error on the screen.

Longer detail:

The screen prints the following error:

Error: Hydration failed because the initial UI does not match what was rendered on the server.

Warning: Expected server HTML to contain a matching <link> in <head>.

See more info here: https://nextjs.org/docs/messages/react-hydration-error

I tried to investigate it that this error was caused by _document.js file. When I remove this file application starts working and print no error.

vdwaseem commented 1 year ago

One possible solution:

The fonts being added in _document.js should be included by using next.js package for loading google fonts i.e. next/font/google

Let me know what you think?

abhimishra01 commented 1 year ago

One possible solution:

The fonts being added in _document.js should be included by using next.js package for loading google fonts i.e. next/font/google

Let me know what you think?

hey @vdwaseem , thank you for pointing out the hydration issue,

the solution you provided seems like a possible one, please feel free to raise a PR if you have resolved the bug at your forked repo