Skip to content
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

Can it work with SPFx 1.17.3 ? #573

Open
2 tasks
Ofer-Gal opened this issue Jun 11, 2023 · 1 comment
Open
2 tasks

Can it work with SPFx 1.17.3 ? #573

Ofer-Gal opened this issue Jun 11, 2023 · 1 comment

Comments

@Ofer-Gal
Copy link

Ofer-Gal commented Jun 11, 2023

Category

  • Enhancement
  • [x ] Bug
  • Question

Version

Please specify what version of the library you are using: [ 3.14.0 ]

Expected / Desired Behavior / Question

See a button for this code

<FilePicker buttonLabel={'Add Files'}
          includePageLibraries={false}  
          onSave={_onFilePickerSave}
          context={this.context} />

Observed Behavior

I get system error in the workbench saying :

ERROR:
Cannot read properties of undefined (reading 'web')

CALL STACK:
TypeError: Cannot read properties of undefined (reading 'web')
    at new FileBrowserService (https://localhost:4321/dist/sp-fx-1173-vanilla-web-part.js:120315:71)
    at new FilePicker (https://localhost:4321/dist/sp-fx-1173-vanilla-web-part.js:114395:36)
    at gr (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:55058)
    at Go (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:74405)
    at Ks (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:117705)
    at wc (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:103931)
    at Cc (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:103859)
    at xc (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:103722)
    at hc (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:100709)
    at uc (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_7a90437cb2e1321248b0dd6c186e382e.js:69:98065)

However, when I change the out of the box class to a functional component and change the code to:

        <FilePicker buttonLabel={'Add Files'}
          includePageLibraries={false}  //hideLinkUploadTab //          hideOrganisationalAssetTab hideRecentTab hideStockImages hideLocalUploadTab
          onSave={_onFilePickerSave}
          context ={context as never}  //Notice the casting!!
 />

It works.

What could be the difference?

Thanks!

@ghost
Copy link

ghost commented Jun 11, 2023

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant