Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '$locales' or its corresponding type declarations #60

Open
RickMeijer opened this issue Nov 25, 2022 · 0 comments
Open

Comments

@RickMeijer
Copy link

When implementing svelte-intl-precompile with the latest sveltekit, I get the following error:

Cannot find module '$locales' or its corresponding type declarations.ts(2307).

Doesn't matter if I use registerAll or individual register. I must be missing something obvious.
I found this PR, but it's not in 0.12 AFAIK.

vite.config.ts:

plugins: [sveltekit(), precompileIntl('locales')]

+layout.ts

import { init, waitLocale, getLocaleFromNavigator } from 'svelte-intl-precompile';
import { registerAll, availableLocales } from '$locales'; // <-- red squiggly here

registerAll();
export async function load() {
	init({
		initialLocale: getLocaleFromNavigator() || undefined,
		fallbackLocale: availableLocales[0]
	});
	await waitLocale();
}

Example repo here:
https://github.com/RickMeijer/svelte-intl-precompile--locales-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant