meilisearch/meilisearch-rust

Panics during search with a 'Headers' error

AceofSpades5757 opened this issue · 3 comments

Description

When trying to query an index, Rust panics. I haven't seen any other issues on this so I have to assume it has something to do with my current configuration. I've had this issue in the past and simple used the HTTP API instead.

use wasm_bindgen_futures::spawn_local;

spawn_local(async move {

    let index = client.index("movies");
    let results: SearchResults<Document> = index.search().with_query(&query).execute().await.unwrap();

});

Expected behavior

To receive results.

Current behavior

Rust panics. This is the console logs from the dev tools.

frontend-c442de88d55f5c.js:334 panicked at 'called `Result::unwrap()` on an `Err` value: JsValue(TypeError: Failed to execute 'append' on 'Headers': Invalid name

Environment (please complete the following information):

  • OS: Windows
  • Meilisearch version: v0.25.2, v0.27.2
  • meilisearch-rust version: v0.17.0
  • Frontend Framework: yew

This seems to be caused by wasm, @irevoire do you have any idea of the issue?

no idea, I guess it has something to do with these two lines;
https://github.com/meilisearch/meilisearch-rust/blob/main/src/request.rs#L109-L110

You were telling me it’s illegal to update the user-agent in chrome, maybe we should not do it. Or at least ignore the result if it fails.

This seems very plausible! I will look into this :) Thanks for raising the issue @AceofSpades5757