hozana / next-translate-routes

Flexible and translated routes for Next.js without custom server
MIT License
116 stars 30 forks source link

Update withTranslateRoutes.tsx #89

Closed joepValvest closed 9 months ago

joepValvest commented 9 months ago

To fix the following error on the latest Next version:

` Failed to compile.

14:21:02.409 |   14:21:02.409 | ./node_modules/next-translate-routes/react/withTranslateRoutes.js:38:0 14:21:02.409 | Module not found: Can't resolve 'next/dist/shared/lib/router-context' 14:21:02.410 |   14:21:02.410 | https://nextjs.org/docs/messages/module-not-found 14:21:02.410 |   14:21:02.410 | Import trace for requested module: 14:21:02.410 | ./node_modules/next-translate-routes/index.js 14:21:02.410 | ./pages/_app.js 14:21:02.410 |   14:21:02.411 |   14:21:02.411 | > Build failed because of webpack errors 14:21:02.598 | ELIFECYCLE  Command failed with exit code 1. 14:21:02.618 | Error: Command "pnpm run build" exited with 1

`

the destination of router context needs to be updated.