Skip to content

[FilePicker]Files keep loading when previewing all files in OneDrive. #1994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wangliantaoTTT opened this issue May 12, 2025 · 5 comments
Open
Assignees

Comments

@wangliantaoTTT
Copy link

wangliantaoTTT commented May 12, 2025

Category
[]Enhancement

[x] Bug

[]Question

Version
Please specify what version of the library you are using:
3.21.0

Expected / Desired Behavior / Question
When using the FilePicker control from @pnp/spfx-controls-react, users should be able to browse and select files from OneDrive normally. The OneDrive tab should load and display the user's files or folders for selection.

Observed Behavior
All other tabs in the FilePicker — such as Recent, Site, and Upload — work as expected and load properly.
When switching to the OneDrive tab in the FilePicker, it shows a loading spinner indefinitely and never displays the files.
Meanwhile, no error is thrown in the UI, but a backend call fails with the following response:

{
"error": {
"code": "-2147024894, System.IO.FileNotFoundException",
"message": "ファイルが見つかりません。" // File not found
}
}

Add the FilePicker control to a custom SPFx property pane or component.

Ensure OneDrive tab is visible (hideOneDriveTab: false).

Click on the OneDrive tab.

Observe that it stays stuck in loading and never shows any file list.

Image

Copy link

Thank you for submitting your first issue to this project.

@wangliantaoTTT
Copy link
Author

wangliantaoTTT commented May 12, 2025

This is the code I used Image

@wangliantaoTTT
Copy link
Author

wangliantaoTTT commented May 12, 2025

I think I’ve found the root cause of the issue.
If the system language is set to Japanese, the Title retrieved for the OneDrive library becomes a Japanese string (e.g. "ドキュメント").
As a result, the constructed URL includes this localized name, leading to a broken path.
However, the correct folder path suffix should always be "Documents" regardless of the system language.
Image

Use EntityTypeName instead of Title when building REST API URLs to avoid issues on non-English systems.

@NishkalankBezawada
Copy link
Contributor

Hello @wangliantaoTTT,

I was able to replicate the issue, and will soon come-up with the solution for the same.

@joelfmrodrigues and @michaelmaillot can you assign this to me.

Thanks,
Nish

@michaelmaillot
Copy link
Collaborator

Hello,

Thanks @wangliantaoTTT for raising this and thanks @NishkalankBezawada for working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants