-
Notifications
You must be signed in to change notification settings - Fork 1k
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