pnp / sp-editor

SP Editor is SharePoint Development Power Tool browser extension
MIT License
44 stars 7 forks source link

SP OnPrem - Search is not working #63

Open diabhoil opened 3 days ago

diabhoil commented 3 days ago

The extension tries to request the context via _api/contextinfo but the headers send are wrong. It receives XML instead of JSON and fails with an error:

grafik

PS: the explanaiting in the README is wrong. There is no "watch" task and the "start" or "cracostart" task do not create the required manifest file for Edge to load the extension.

tavikukko commented 3 days ago

Thanks @diabhoil ! Could you please paste the headers sent to _api/contextinfo, and if you have idea what it should be, that would be great, thanks!

And yes, need to update the Readme with updated instructions.

diabhoil commented 3 days ago

Hey @tavikukko

Headers are (I removed some values with "---"):

POST /_api/contextinfo HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: ---
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 0
Content-Type: application/json;charset=utf-8
Cookie: ---
Host: ---
Origin: ---
Pragma: no-cache
Referer: ---
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: ---
X-ClientService-ClientTag: SPEDITOR
X-PnP-BatchNever: 1
X-PnP-CacheAlways: 1
X-PnP-CacheKey: 782933992
X-PnPjs-NoDigest: 1
X-PnPjs-RequestId: ---
sec-ch-ua: ---
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"

The "Accept" header should be "application/json; odata=verbose".

tavikukko commented 3 days ago

Ok, this seems to be issue in PnPJS, and its the backbone of SP Editor. Could you test, what else is failing in OnPrem? Thanks!

diabhoil commented 3 days ago

Well as far as I tested on a SharePoint 2013 (it is kinda old and out of support anyway, but I guess its the same for 2016 and maybe in some parts for 2019 too):

tavikukko commented 2 days ago

Wow, thank you @diabhoil ! I think i can get forward with this information!