Pnpjs: Can't read JSON content file by serverRelativeUrl

Created on 7 Mar 2019  路  2Comments  路  Source: pnp/pnpjs

Category

  • [ ] Enhancement
  • [x ] Bug
  • [x ] Question
  • [ ] Documentation gap/issue

Version

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

Please specify what version(s) of SharePoint you are targeting: [ Online ]

Expected / Desired Behavior / Question

How to get JSON file content from document library in IE 11?
It works in Chrome, Opera, Firefox, Edge.

Observed Behavior

Can't read JSON data from file.
I'm gettint the error:
image
SCRIPT7002: XMLHttpRequest: Network Error 0x80700013, Could not complete the operation due to error 80700013.

Steps to Reproduce

  1. Add 'fileName.json' file at 'Site Assets' library with content bellow:
    {"key":"value"}

  2. Read file content:

let web = new Web("https://contoso.sharepoint.com/sites/contoso");
let fileContent = await web.getFileByServerRelativeUrl("/sites/contoso/SiteAssets/settings.json");
let content = await settings.getJSON();
sample answered question

Most helpful comment

All 2 comments

Closing this as it is addressed in the documentation already linked here in the issue.

Was this page helpful?
0 / 5 - 0 ratings