SharePoint / SharePoint/sp-dev-docs
Updates not reflected on Page Load due to build.rig task order
@Amey-MSFT is already working on this.
Since May 29, 2025.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- browser version (latest)
- SPFx version 1.19.0
- Node.js version 18.17.1
Describe the bug / error
Due to the predefined ordering of packing tasks in build.rig, the subtask spfx-serve renders a page before webpack completes. The reload task does not appear to reload the browser, and therefore forces a manual refresh on behalf of the developer once webpack tasks are completed.
I looked into adding pre-telemetry and pre-build tasks by copying the execution of the predefined subtasks, but this does not seem to work (and can't find any examples of anyone doing this).
Steps to reproduce
- Make updates to your SPFX
- Run gulp serve
- SPFX-serve loads the page before updates are actually compiled
Expected behavior
Ideally, spfx-serve should be user-configurable to run at any point in the pipeline, but personally I would like it to be last by default. Yes, it's nice to have hot reload, but when working with multiple developers on a complex project, we will frequently be out of watch mode.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.