SharePoint / SharePoint/sp-dev-docs

Form Customizer doesn't work in development mode if using SPComponentLoader

Open
#10,352 3 comments 3 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Jul 29, 2025.

area:spfx-extensions sharepoint-developer-support type:bug-confirmed type:bug-suspected
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

Windows

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
    "dependencies": {
        "@fluentui/react": "8.122.11",
        "@microsoft/decorators": "1.20.0",
        "@microsoft/sp-adaptive-card-extension-base": "1.20.0",
        "@microsoft/sp-core-library": "1.20.0",
        "@microsoft/sp-listview-extensibility": "1.20.0",
        "@microsoft/sp-lodash-subset": "1.20.0",
        "@microsoft/sp-office-ui-fabric-core": "1.20.0",
        "@microsoft/sp-property-pane": "1.20.0",
        "@microsoft/sp-webpart-base": "1.20.0",
        "@pnp/sp": "2.0.5",
        "@pnp/spfx-property-controls": "3.19.0",
        "gulp-zip": "5.1.0",
        "office-ui-fabric-react": "7.204.1",
        "react": "17.0.1",
        "react-dom": "17.0.1",
        "tslib": "2.8.1"
    }
Describe the bug / error
Could not load form-customizer in require. Error: Script error for "@microsoft/sp-loader", needed by: eb5b767e-543b-453d-9d32-ef15f53ae1da_1.1.0.4
https://requirejs.org/docs/errors.html#scripterror
    at makeError (eval at e (sp-list-form-application-assembly_en-us_65c077022f3cac7b1722da811f98fc5d.js:211:11669), <anonymous>:5:1843)
    at HTMLScriptElement.onScriptError (eval at e (sp-list-form-application-assembly_en-us_65c077022f3cac7b1722da811f98fc5d.js:211:11669), <anonymous>:5:17037)
Steps to reproduce

Create SPFx package with form customizer in it
Use SPComponentLoader in your code:

import { SPComponentLoader } from '@microsoft/sp-loader';
...
SPComponentLoader.loadScript(...)

Run gulp serve
Apply customizer to some list
When opening a form blank screen appears with console error

Could not load form-customizer in require. Error: Script error for "@microsoft/sp-loader"

Form customizer works OK if package is built in release mode and code isn't hosted from localhost.

Expected behavior

Form customizer is rendered normally

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.