remix icon indicating copy to clipboard operation
remix copied to clipboard

Fresh Remix project comes with errors out the box

Open MrSiby opened this issue 3 years ago • 4 comments

What version of Remix are you using?

1.7.5 - 1.7.6

Steps to Reproduce

PNPM

pnpx create-remix@latest
# use default options (Remix app server, typescript etc)
cd my-remix-app/
pnpm run dev

NPM

npx create-remix@latest
# use default options (Remix app server, typescript etc)
cd my-remix-app/
npm run dev

Expected Behavior

I expect a fresh install to work without error.

Actual Behavior

Console errors when running the website

Warning: Expected server HTML to contain a matching

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

Warning: An error occurred during hydration. The server HTML was replaced with client content in <#document>.

Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.

MrSiby avatar Nov 20 '22 14:11 MrSiby

This is probably because one of your browser extensions is injecting code : https://remix.run/pages/gotchas#browser-extensions-injecting-code

MichaelDeBoey avatar Nov 20 '22 21:11 MichaelDeBoey

I did have this issue once because of the Google Analytics Opt-out extension, however, this time the error was present with all extensions disabled as well as in incognito.

I did manage to get rid of it by modifying the dev script like so

  "scripts": {
    "dev": "NODE_ENV=development remix dev",
  },

MrSiby avatar Nov 20 '22 21:11 MrSiby

We removed the NODE_ENV=development with a reason, but I don't know why anymore 🤔 @chaance can probably give more insights here

MichaelDeBoey avatar Nov 21 '22 00:11 MichaelDeBoey

NODE_ENV=development r

I tried this but I'm getting the error "The connection was reset" from Firefox and the page is not loaded correctly :thinking:

jdnichollsc avatar Jan 18 '23 16:01 jdnichollsc

My issue was caused by Apollo Developer Tools, removing it from Firefox stopped this error.

Asjas avatar Feb 22 '23 09:02 Asjas

This is definitely a problem with React hydration and extensions/third-party code injecting code that creates a mismatch. I ran a fresh install and couldn't reproduce the console errors in any browser, so I'm going to close this one.

chaance avatar Feb 24 '23 00:02 chaance