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

Error when evaluating SSR module #160

Open
do-web opened this issue Apr 24, 2023 · 4 comments
Open

Error when evaluating SSR module #160

do-web opened this issue Apr 24, 2023 · 4 comments

Comments

@do-web
Copy link

do-web commented Apr 24, 2023

Describe the bug

It seams the bug is coming from astro-i18next/src/components/index.ts

8:57:26 PM [vite] Error when evaluating SSR module /node_modules/astro/astro.js:
|- SyntaxError: Invalid or unexpected token
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/Private/astro/node_modules/vite/dist/node/chunks/dep-24daf00c.js:54348:28)

8:57:26 PM [vite] Error when evaluating SSR module /node_modules/astro-i18next/src/components/Trans.astro: failed to import "/node_modules/astro/astro.js"
|- SyntaxError: Invalid or unexpected token
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/Private/astro/node_modules/vite/dist/node/chunks/dep-24daf00c.js:54348:28)

8:57:26 PM [vite] Error when evaluating SSR module /node_modules/astro-i18next/src/components/index.ts: failed to import "/node_modules/astro-i18next/src/components/Trans.astro"
|- SyntaxError: Invalid or unexpected token
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/Private/astro/node_modules/vite/dist/node/chunks/dep-24daf00c.js:54348:28)

8:57:26 PM [vite] Error when evaluating SSR module /src/layouts/Layout.astro: failed to import "/node_modules/astro-i18next/src/components/index.ts"
|- SyntaxError: Invalid or unexpected token
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/Private/astro/node_modules/vite/dist/node/chunks/dep-24daf00c.js:54348:28)
  • astro-i18next version: latest
  • astro version: latest
  • OS: mac
  • Browser: chrome

My config:

const config: AstroI18nextConfig = {
  defaultLocale: "en",
  locales: ["en", "de"],
  load: ["server", "client"],
  i18nextServer: {
    debug: false,
    backend: {
      loadPath: './public/locales/{lng}.json',
      addPath: '/locales/{lng}/{ns}.missing.json',
    },
    interpolation: {
      prefix: "{",
      suffix: "}",
    }
  },
  i18nextClient: {
    debug: false,
    backend: {
      loadPath: '/locales/{lng}.json',
      addPath: '/locales/{lng}/{ns}.missing.json',
    },
    interpolation: {
      prefix: "{",
      suffix: "}",
    }
  }
};
@williamsjokvist
Copy link

I got the same issue and downgrading Astro doesn't seem to help. I've tried building old commits which built successfully before as well, maybe a Vite update is causing this?

@do-web
Copy link
Author

do-web commented Apr 24, 2023

I dont know, actually i have not made any update. what exactly did you do to make it work again?

@do-web
Copy link
Author

do-web commented Apr 24, 2023

I downgraded to astro 2.2.2 so its not working with astro 2.3.0.
Maybe @yassinedoghri can fix this?

@williamsjokvist
Copy link

Downgrading Astro to 2.1.3 made it work for me!

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

2 participants