Npm packages containing invalid code

Some npm packages contain invalid JavaScript code that can crash Node.js.

The usual workaround is to add the npm package to vite.config.js > ssr.noExternal, see Broken npm package.

Hydration mismatch

If you use SSR then a recurring issue are so-called hydration mismatches: a hydration mismatch is when the content rendered to HTML on the server isn't the same as the content rendered in the browser.

See Hydration Mismatch for explanations, solutions, and workarounds.