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

Astro fails to build with prefixDefaultLocale: true, #9354

Closed
1 task
Cacamoto opened this issue Dec 6, 2023 · 0 comments · Fixed by #9380
Closed
1 task

Astro fails to build with prefixDefaultLocale: true, #9354

Cacamoto opened this issue Dec 6, 2023 · 0 comments · Fixed by #9380
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: i18n Related to internalization (scope)

Comments

@Cacamoto
Copy link

Cacamoto commented Dec 6, 2023

Astro Info

Astro                    v4.0.3
Node                     v21.3.0
System                   macOS (arm64)
Package Manager          npm
Output                   hybrid
Adapter                  @astrojs/node
Integrations             @astrojs/tailwind
                         @astrojs/solid-js

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

If I set prefixDefaultLocale: false, astro build works just fine. If I chage it to true, it fails with this CLI message:

 prerendering static routes 
Cannot find module .../dist/server/src/pages/index.astro' imported from .../node_modules/astro/dist/core/build/generate.js

And I'm not missing the /pages/index.astro

My astro.config.mjs:

import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import solidJs from "@astrojs/solid-js";
import node from "@astrojs/node";

// https://astro.build/config
export default defineConfig({
  integrations: [tailwind(), solidJs()],
  output: "hybrid",
  i18n: {
    defaultLocale: "en_",
    locales: ["en_", "lt_"],
    routing: {
      prefixDefaultLocale: true,
    },
  },
  adapter: node({
    mode: "standalone",
  }),
});

What's the expected result?

Succesful build

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-cwevfa

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 6, 2023
@natemoo-re natemoo-re added feat: i18n Related to internalization (scope) - P4: important Violate documented behavior or significantly impacts performance (priority) labels Dec 6, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Dec 6, 2023
@ematipico ematipico self-assigned this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: i18n Related to internalization (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants