I'm trying to use the @lit/localize library. I have followed the documentation https://lit.dev/docs/localization/overview/
I've also looked at the sample application https://github.com/lit/lit/tree/main/packages/localize/examples/runtime-ts
What I'm struggling with is that when I pass a parameter for language (http://localhost:3001?locale=es-419) I get the following error
Cannot find module './es-419.js'
at http://localhost:3001/asset-src_routable-components_UsersScreen_ts.js:54:11
What I have noticed is that if I pass the default language of "en" in the URL the screen loads fine. If i pass junk locale it will give me a different error saying invalid locale code.
It feels like for some reason my locale*.js file is not being built into the project properly. I have followed the link in the comments and tried to add the extensions. But that does not work either
module.exports = (env, argv) =>
merge(customConfigs(env, argv), {
resolve: {
extensions: ['.ts', '.js'],
}
});