Skip to content

Unable to create folders in document library after deploying SPFx Extension that loads javascript file (10357 is unresolved) #10374

@dmahendranme

Description

@dmahendranme

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

  1. 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();
  1. Deploy the solution and select "Make this solution available to all sites....."
  2. Navigate to any document library
  3. Create a folder

Expected behavior

You will receive "Illegal invocation" error on both console and UI

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.sharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions