It seems whenever the file updates the route is not actually refreshed and it just adds the updated content to the page. Disabling HMR solves this issue as it does a full reload.