# Masonry JS does not draw on page load with 'npm start' (OK after build:production)

**URL:** https://discourse.roots.io/t/masonry-js-does-not-draw-on-page-load-with-npm-start-ok-after-build-production/18349
**Category:** sage
**Tags:** sage9
**Created:** 2020-05-27T20:35:55Z
**Posts:** 4
**Showing post:** 2 of 4

## Post 2 by @alwaysblank — 2020-05-27T21:42:45Z

Usually when things work on `build` but not `start` it has to do with [Hot Module Replacement (HMR)](https://webpack.js.org/guides/hot-module-replacement/). Sage 9 uses HMR so that styles, etc, can be updated in the browser while `start` is running without reloading the page. It’s a cool feature! But because it “reloads” content by directly modifying the DOM, it sometimes doesn’t trigger particular document events that other things might be expecting (i.e. `onload`) or it triggers them at the wrong time (i.e. before things have actually loaded).

I haven’t tested this out myself, but this post has a quick fix to disable HMR and BrowserSync, so `start` will still watch and rebuild your assets, you just have to reload the page in your browser manually: [Is it possible to "watch" without browsersync?](https://discourse.roots.io/t/is-it-possible-to-watch-without-browsersync/17730/7)

Alternatively, you could refactor your code to trigger off of some other event that isn’t tied to document load (this is probably why `msnry.layout()` works when triggers off the click in your code).

---

_[View the full topic](https://discourse.roots.io/t/masonry-js-does-not-draw-on-page-load-with-npm-start-ok-after-build-production/18349)._
