I encountered the same issue but resolved it by linking to the CSS file directly instead of using CSS modules.
In the questioner's code, it would look like this:
export const links: LinksFunction = () => {
return [
{
rel: "stylesheet",
href: "../styles/index.css"
}
];
};