hayes0724 / shopify-packer

Modern development tool for Shopify using Webpack 5. Easy to extend and customize, zero build config, compatible with Slate and existing websites.
https://hayes0724.github.io/shopify-packer/
MIT License
181 stars 37 forks source link

[BUG] file upload doesn't always correctly update frontend after refresh #50

Closed adrianocr closed 3 years ago

adrianocr commented 3 years ago

Describe the bug Not always, but sometimes packer/themekit uploads a file and refreshes the page as it should, but the refresh doesn't actually load the new updated file or changes. It still contains the old markup and content. Then you manually refresh and the changes are there. I assume this is an issue with the shopify backend taking a little longer than expected to process the file so a solution may be to add a 0.5s delay to refreshing the page?

Expected behavior After themekit uploads a file, the page should refresh like it currently does, but it should load the updated file(s).

System (please complete the following information):

Packer (please complete the following information):

hayes0724 commented 3 years ago

I had previously added a delay for this issue, sometimes it's needed and other times it loads quick enough not to need it. I think this would be a good setting to have in config (an adjustable delay rate)

adrianocr commented 3 years ago

@hayes0724 I agree! Maybe an option in the .env file that lets the user stipulate how many ms to delay by

hayes0724 commented 3 years ago

Fixed in v1.3.6

usage (packer-config.js):

module.exports = {
  // Add a reload delay before refreshing browser in ms, Shopify may need several seconds
  'network.reload': 0,
}