Closed as not planned
Closed as not planned
Description
What version of Remix are you using?
1.7.0
Steps to Reproduce
- Install Lastpass (I think you should also be registered...?)
git clone https://github.com/giltayar/remix-import-css-lastpass-hydration-error-reproduction
npm install
npm run dev
- This should show the page with no errors in console
Now...
- Edit
root.tsx
and comment in the<link rel=stylesheet>
.
Or...
- Edit
root.tsx
and comment in the<style>
tag.
Expected Behavior
Opening the page in Chrome or Firefox: No errors in the console
Actual Behavior
Errors in console*:
For Firefox, DevTools must be open (with "disable cache" checked in the Network tab). For Chrome, even closed will trigger the problematic behavior (!)
Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server
and...
.
link
Scripts@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:2851:7
body
html
App
RemixRoute@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:2529:20
Routes2@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:2513:7
Router@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:741:7
RemixCatchBoundary@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:1018:28
RemixErrorBoundary@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:944:5
RemixEntry@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:2406:20
RemixBrowser@http://localhost:3000/build/_shared/chunk-IMF64WG6.js:3150:27
Note that the error also happened to me when using a @import
in an "emotion css" global rule (that is how I found it out). After much research, I found the problem also occurs with link rel
. You have a reproduction of both in this repo.
Also note that Lastpass Definitely triggers the problem, but playing around with this reproduction shows me that all the other parameters are fluid in regards to reproducability:
- Whether Chrome or Firefox
- Whether devtools is open
- Whether "disable cache" is turned on
- Whether using
links
function,link rel
inhead
, or using@import
.