NuxtN
Nuxt3y ago
spohl

i18n not working with static site generation

Hi,
i try to create static sites (ssr:false).
When i launch the site i hit: "GET file:///i18n-config-3b43adf8.js net::ERR_FILE_NOT_FOUND"
This file is not generated at all, but a familar one: "i18n.config.64f65730.js".

Originated from: "i18n.options.2fc0184e.js" , find the code below.

import { b$ as __vitePreload, c0 as sharedExports } from "./entry.f6cb9516.js";
async function i18n_options(context) {
  const loader = await __vitePreload(() => import("./i18n.config.64f65730.js"), true ? ["./i18n.config.64f65730.js","./entry.f6cb9516.js","./entry.9e1e5f52.css"] : void 0, import.meta.url).then((m) => m.default || m);
  const config = sharedExports.isFunction(loader) ? await loader(context) : sharedExports.isObject(loader) ? loader : {};
  {
    let messages = null;
    try {
      const key = `/i18n-config-3b43adf8.js`;
      messages = await __vitePreload(() => import(                 //// <-------------------- Here it happens
        /* @vite-ignore */
        key
        /* webpackChunkName: nuxt-i18n-config-3b43adf8 */                
      ), true ? [] : void 0, import.meta.url).then(
        (m) => m.default || m
      );
    } catch (e) {
      console.error(format(e.message));
    }
    config.messages = messages || {};
    return config;
  }
}
export {
  i18n_options as default
};


Running in dev mode everything running smooth..
In this static mode, there is not vite at all involved (file://).

Not sure how to tackle this one, any idea much appreciated.
Was this page helpful?