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

SP OnPrem - Search is not working #63

Open
diabhoil opened this issue Sep 16, 2024 · 5 comments
Open

SP OnPrem - Search is not working #63

diabhoil opened this issue Sep 16, 2024 · 5 comments

Comments

@diabhoil
Copy link

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
Copy link
Collaborator

tavikukko commented Sep 16, 2024

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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):

  • PnP JS Console: same error (obviously)
  • Graph SDK (makes no sense for OnPrem only)
  • MGT React Playground (I guess the same...not really tested because I can not login to the app)
  • Web Properties: reading: working, edit: not working because of the same error
  • List Properties: reading: working, edit: not working because of the same error
  • SP Shooter: works, but I have to set the header default value for Accept from "application/json; odata=nometadata" to "application/json; odata=verbose", otherwise the response format is XML and that can not be handled
  • Webhooks: I am not sure but I would think this is SPO related (or maybe for newer OnPrem versions)
  • ScriptLinks: not tested, reading seems to work but I do not have any. At least there is a normal json response with an empty array. Adding is not working/doing anything. "Modern ScriptLinks App" is (obviously) not working.

@tavikukko
Copy link
Collaborator

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

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

2 participants