SharePoint / SharePoint/sp-dev-docs
Unable to create folders in document library after deploying SPFx Extension that loads javascript file (10357 is unresolved)
@Ashlesha-MSFT is already working on this.
Since Aug 20, 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
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
No response
Describe the bug / error
We have a analytics tool that requires javascript file to be called.
Created SPFx extension (App Customizer) to load the javascript file.
Used SPComponentLoader.loadScript method to load a javascript file present in a site's style library.
javascript file has analytics code.
All SharePoint pages loads fine and everything is tracked in our analytics tool. I'm able to create documents in the library but i'm unable to create a folder.
This is duplicate of 10357 as it is closed with no solution
Response from the contributor shows that contributor did not understand the issue completely.
I have responded to contributor's reply in 10357. Please check.
Refer the issue screenshots from 10357
Steps to reproduce
- Create SPFx extension -> Application customizer
public onInit(): Promise<void> {
Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
const userName = this.context.pageContext.user.displayName;
(window as any).someconfig = {
userName: userName
};
SPComponentLoader.loadScript('/Style%20Library/<javascript_snippet_file>.js');
return Promise.resolve();
- Deploy the solution and select "Make this solution available to all sites....."
- Navigate to any document library
- Create a folder
Expected behavior
You will receive "Illegal invocation" error on both console and UI
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.