Closed sdk1990 closed 11 months ago
It seems to be because the RouterContext
is now exported from:
import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime'
Instead of:
import { RouterContext } from 'next/dist/shared/lib/router-context'
@cvolant I created #81 with a fix for this issue
@cvolant Still an issue. Just tried with latest nextjs (page router) and getting this error
package.json
{
"name": "test-translate-route",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "14.0.4",
"next-translate-routes": "^1.10.2",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}
On the latest version of Next.js (13.5.1), compilation fails due to a Next module which is not found within the next-translate-routes package.
This is the message which is shown in my console:
../../node_modules/next-translate-routes/react/withTranslateRoutes.js:38:0 Module not found: Can't resolve 'next/dist/shared/lib/router-context'