How to Fix SPFx ListView Command Set Extension Not Loading
Question details
The user is attempting to troubleshoot a SharePoint Framework (SPFx) ListView Command Set extension that fails to load, producing a browser warning about a preloaded JavaScript resource.

- Product
- SharePoint Framework
- Device & OS
- not provided
- Scenario
- Running the gulp serve command to locally test a custom SPFx ListView Command Set extension that includes custom dialog code.
- Observed behavior
- The extension fails to load in the development environment and triggers a browser warning related to a preloaded JavaScript resource.
Verify that your Node.js version is fully compatible with your specific SPFx version, and ensure there are no syntax errors in your TypeScript files before running the local server.
Review the @microsoft/sp-dialog Package Usage
A common cause for an SPFx ListView Command Set failing to load is an initialization issue or conflict involving the @microsoft/sp-dialog package in custom dialog code.
Many developers encounter browser warnings and loading failures when using the @microsoft/sp-dialog module within SPFx ListView Command Sets. Temporarily isolating this package helps confirm if it is the root cause of the extension failure.
Open your SPFx project in your code editor and navigate to the main `.ts` file for your ListView Command Set extension.
Comment out the `import` statements for `@microsoft/sp-dialog` and any functions invoking the custom dialog to isolate the issue.
Open your terminal, terminate the existing process, and run `gulp serve` again. If the extension loads successfully, the issue is directly tied to the dialog package implementation.

Post the Issue in Microsoft Q&A
Because SPFx development involves specialized custom code, reaching out to the Microsoft developer community is the most effective way to resolve complex module conflicts.
Need a Lightweight Office Suite? Try WPS Office
While resolving complex Microsoft SharePoint development issues, you may still need a reliable, fast, and free office suite for your daily documentation and coding notes. WPS Office provides an all-in-one solution for processing documents, spreadsheets, and presentations.
- 1. Download the Installer: Visit the official WPS Office website and click the Free Download button.
- 2. Install the Software: Run the downloaded executable file and follow the on-screen instructions to complete the setup.
- 3. Open and Edit Files: Launch WPS Office and instantly open your existing Office documents without formatting loss.

Frequently Asked Questions
Why does gulp serve trigger a preloaded JavaScript resource warning?
This warning typically occurs when the SharePoint Framework tries to load a dependency (like a custom dialog package) that fails to initialize properly, causing the browser to flag the script as preloaded but unused.
How can I debug my SPFx ListView Command Set extension locally?
You can debug locally by running the `gulp serve` command, which launches the local workbench or your specified SharePoint tenant URL with query parameters that load your development manifest.
Is @microsoft/sp-dialog fully supported in ListView Command Sets?
While supported, there are known version-specific bugs and implementation caveats when using @microsoft/sp-dialog within ListView Command Sets. Developers frequently discuss workarounds for these loading failures on Stack Overflow and Microsoft Q&A.




