Skip to content

Advanced router (default locale no prefix) with static adapter? #167

Description

@kratos-digital

How to use static adapter with example in locale-router-advanced? What I need is to have my default locale without prefix, but files should be built statically. Static adapter works with locale-router-static, but every language has prefix there and the index.html only has JS redirection to default locale.

In svelte.config.js I have this:

const config = {
	kit: {
		adapter: adapter({
			pages: 'build',
			assets: 'build',
			fallback: undefined,
			precompress: false,
			strict: true
		}),
		prerender: {
			// This works when all locales are prefixed
			// entries: ['/'].concat(supportedLocales.reduce((acc, locale) => [...acc, `/${locale}`], ['*']))
			entries: ['*', '/', '/en'] // throws error below (hr default locale, en secondary locale)
			// entries: ['*', '/en'] // generates only files for english locale, and nothing for default
		}
	},
	preprocess: vitePreprocess(),
	compilerOptions: {
		customElement: true
	}
};

All I get is this useless error:

node:internal/event_target:1083
  process.nextTick(() => { throw err; });
                           ^
Error: 500 /

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions