For debugging, add console.log(nuqs)
before your mediaSearchParamsParsers
declaration. Inspect the output in your browser's console (or server logs if it's running on the server). Does it contain parseAsString
? If so, what does it look like? Does it have the withDefault
method?
import * as nuqs from 'nuqs';
console.log("nuqs object:", nuqs); // Inspect the nuqs object
export const mediaSearchParamsParsers = {
search: nuqs.parseAsString.withDefault(''),
view: nuqs.parseAsString.withDefault('grid'),
};
Use your browser's developer tools (or a server-side debugger if applicable) to set breakpoints and step through the code. Examine the value of parseAsString
at runtime.