Yrobot / i18next-ssg

The package for i18n next.js project SSG (static site generate) (html build)
https://codesandbox.io/p/github/yrobot-demo/i18next-ssg/master
MIT License
34 stars 3 forks source link

Unable to route to or build site root #8

Closed csm-kb closed 1 year ago

csm-kb commented 1 year ago

https://github.com/Yrobot/i18next-ssg/blame/b009d49145f214e1898e4fd7e5312447beccbdce/src/router.ts#L10

I'm using

    "next": "~13.4.1",
    "i18next-ssg": "^3.0.2",

so the freshest available for both.

Let me know if I'm somehow incorrect, but I'm observing the following erratic behavior:

Build error occurred TypeError: Cannot read properties of undefined (reading '_isAppDir') at O:_web\idol-showdown-app\node_modules\next\dist\export\index.js:412:39 at Array.filter () at O:_web\idol-showdown-app\node_modules\next\dist\export\index.js:411:43 at async Span.traceAsyncFn (O:_web\idol-showdown-app\node_modules\next\dist\trace\trace.js:103:20) at async O:_web\idol-showdown-app\node_modules\next\dist\build\index.js:1483:21 at async Span.traceAsyncFn (O:_web\idol-showdown-app\node_modules\next\dist\trace\trace.js:103:20) at async O:_web\idol-showdown-app\node_modules\next\dist\build\index.js:1339:17 at async Span.traceAsyncFn (O:_web\idol-showdown-app\node_modules\next\dist\trace\trace.js:103:20) at async build (O:_web\idol-showdown-app\node_modules\next\dist\build\index.js:143:29) error Command failed with exit code 1.

Note the erroneous //index it supposedly sees, instead of just / or similar. The /en and /jp routes work as expected.

I replicate the example project precisely, with the following structure:

- pages
  - [locale]
    - index.tsx
  - _app.tsx
  - [[...paths]].tsx
- public
  - locales
    - en
      - common.json
    - ...

and with [[...paths]].tsx and _app.tsx both matching the README. Is this potentially being caused by the current useRootPathRedirect implementation?

Yrobot commented 1 year ago

Hi @csm-kb

I update the deps in the demo to the latest version, but i could not reproduce your bug. could you plz try the demo, or provide more info, which would be very greatful.

Yrobot commented 1 year ago

Could not reproduce the bug