Array.includes works in dev but not in prod

Hi, I am new to vue and not very used to the javascript language. I am stucked since 3 days on a problem I cannot solve.
I use vuex and have a store with one module “fermentable”.
Fermentables are products that are stored in a Database and have a brand_id property.
Aside there is a record in the Database that stores the user’s preferences. Among these preferences are brands_fermentable, types_fermentable and raw_ingredient_fermentable
In the index.js of store, there is:

state.userPreferences: Object
    ...
    brands_fermentable : Array []
   raw_ingredients_fermentable: Array[]
    types_fermentable: Array []

that I load with a relevant request to the backend.

These are used to filter the full list of fermentables by there respective properties brand_id, raw_ingredient and type.
The idea is to select only fermentables whose brand_id is listed in the brands_fermentable array, and so on for raw_ingredient and type.

In the fermentable module of the store I have a

state.fermentables: Array [] 

that I load with relevant request to the backend.

To filter, in the view where I display the list of seclected fermentables I first call the relevant actions (with dispatch) in the store to get the userPreferences and in the fermentable module to load the fermentables.

then I have this in my view

const Fermentables = computed(
    () => store.getters["fermentable/selectedFermentables"]
);

that is the list of fermentable I display.

Here is the getter i use above

selectedFermentables: (state, getters, rootState) => {
        let result = [];
        let prefs;
        if (prefs = store.getters["preferredFermentableBrands"] ) {
            console.log("here are prefs");
            console.log(prefs);
            console.log('here are fermentables');
            console.log(state.fermentables);
            //filter by selected brands
            state.fermentables.forEach((f) => {
                if (prefs.includes(f.brand_id)) {
                    console.log('push one');
                    result.push(f);
                } else {
                    console.log(prefs);
                    console.log('does not include ' + f.brand_id);           
                }
            });
        } else {
            console.log("I take no one");
            result =  [];
        }

        console.log("result L is " + result.length);
        let result2 = [];
        //filter by selected raw ingredient
        if (prefs = store.getters["preferredFermentableRawIngredients"]) {
            result.forEach((f) => {
                let test = prefs.indexOf(f.raw_ingredient);
                if (test != -1) {
                    result2.push(f);
                }
            });
        } else {
            result2 = result;
        }
        console.log("result2 L is " + result2.length);
        let result3 = [];
        //filter by selected types
        if (prefs = store.getters["preferredFermentableTypes"] ) {
            //                prefs = rootState.userPreferences.types_fermentable) {
            let s = JSON.stringify(prefs);
            result2.forEach((f) => {
                let test = s.indexOf(f.type);
                if (test != -1) {
                    result3.push(f);
                }
            });
        } else {
            result3 = result2;
        }
        console.log("result3 L is " + result3.length);
        return result3;
    },

As you can se the getter filters as described above in 3 stages, first by preferred brands, then by raw_ingredients and finally by types.

In development, using the vite server (localhost:3000) it works perfectly but (and here is the main trouble) in production it doesn’t work.
The problem is visible with the various console.log

On this picture we can see that in the first stage of the filter, despite the fact that the brand_id of the fermentable (1) is in the prefs array, the array.includes statement says it is not.
The same is true for fermentable whose brand_id is 24.
I must add that the trouble is the same using array.indexOf instead of array.includes.

My question is why this filter works pretty well in dev but not in prod ?

Just an idea: you have different types, e.g. compare 1 and "1"?

Thank you for your response. When doing console.log(typeof(prefs[0]) and console.log(typeof(f.brand_id)) both return number.

I spoke a little too fast. What I said previously is for dev. For the sake on conscience I tried the same in prod and, ho surprise! , the return was number and string. Thus i casted to number and now it works. May be different servers return different things (types) for the same request.
Whatever it is, thank you very much: you took a long thorn out of my hand and I learn every day thanks to people like you.