Using Search REST API with SPFx & SPHttpClient should return search results for the passed querytext parameter with Firefox. It does so with Chrome & IE11.
With Firefox the result ends up to server status code 500 Internal Server Error the response payload being the following:
{"odata.error":{"code":"-1, Microsoft.Office.Server.Search.REST.SearchServiceException","message":{"lang":"en-US","value":"An unknown error occurred."}}}
This behavior can only be reproduced on SharePoint 2019 RTM. On SharePoint 2016 January 2018 CU the same search API call works as expected with Firefox with the same exact code.
Using this simplified snippet in a SPFx webpart to retrieve data via Search by editing the URL value to match the environment and the render method being the webpart's render method.
public render(): void {
this._getSearchData("http://sharepoint2019.sp.test/_api/search/query?querytext='*'").then((res: any) => {});
}
private _getSearchData(url: string): Promise<any> {
return this.context.spHttpClient.get(url, SPHttpClient.configurations.v1, {
headers: {
'odata-version': '3.0',
'accept': 'application/json;odata=verbose',
'content-type': 'application/json;odata=verbose'
}
}).then((res: SPHttpClientResponse) => {
return res.json();
}).catch(error => {
return Promise.reject(JSON.stringify(error));
});
}
will result to 500 Internal server error with Firefox

Add SelectProperties to your query.
For instance: &SelectProperties='Title'
Hey,
I had the same issue just now and i've dug in.
So to summarize: The bug is that the SharePoint Search REST API cannot serialize datetime (and possibly other types?) using odata version 4.
The work-around is to fall back to version 3. See below.
let config: SPHttpClientConfiguration = new SPHttpClientConfiguration({
defaultODataVersion: ODataVersion.v3
});
this.props.context.spHttpClient.get(this.props.context.pageContext.web.absoluteUrl + searchUrl, config, { headers: { Accept: "application/json;odata=minimalmetadata;charset=utf-8" } }).then((response) => {
Most helpful comment
Hey,
I had the same issue just now and i've dug in.
So to summarize: The bug is that the SharePoint Search REST API cannot serialize datetime (and possibly other types?) using odata version 4.
The work-around is to fall back to version 3. See below.