iammatthias / com

Digital garden built using Astro, Obsidian, and other goodies.
https://iammatthias.com
216 stars 36 forks source link

Rebass styles not applied on first load #59

Closed iammatthias closed 5 years ago

iammatthias commented 5 years ago

Rebass media queries are not applied correctly after site is built and published on Netlify. Styles behave properly in local development.

Steps to Reproduce

  1. Clear cache and reload page https://iammatthias.com (Shift + Command + R)
  2. Page will present incorrectly
  3. After page refresh, content loads as expected
  4. If content does not load correctly after refresh, try again. It can take 3-4 attempts.

References:

Proposed Solutions

Expected

image

Result

image
wiput1999 commented 5 years ago

Hmmmm I'm facing the same here

iammatthias commented 5 years ago
import Layout from './src/components/general/Layout'

export const wrapPageElement = ({ element, props }) => {
  return <Layout {...props}>{element}</Layout>
}

Got removed from gatsby-browser and gatsby-ssr. Added the above snippet, and all is well.