Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch next-translate-routes@1.10.2 for the project I'm working on.
library next-translate-routes didnt work ,i got error like this ===>Module not found: Can't resolve 'next/dist/shared/lib/router-context'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/next-translate-routes/index.js
./pages/_app.tsx
Using external babel configuration from /Users/bogdan/Documents/work/landing/.babelrc.js
โจฏ ./node_modules/next-translate-routes/react/withTranslateRoutes.js:38:1
Module not found: Can't resolve 'next/dist/shared/lib/router-context'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/next-translate-routes/index.js
./pages/_app.tsx
GET / 500 in 7289ms
Here is the diff that solved my problem:
diff --git a/node_modules/next-translate-routes/react/withTranslateRoutes.js b/node_modules/next-translate-routes/react/withTranslateRoutes.js
index f9d2804..e2cff27 100644
--- a/node_modules/next-translate-routes/react/withTranslateRoutes.js
+++ b/node_modules/next-translate-routes/react/withTranslateRoutes.js
@@ -35,7 +35,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.withTranslateRoutes = void 0;
-var router_context_1 = require("next/dist/shared/lib/router-context");
+// var router_context_1 = require("next/dist/shared/lib/router-context");
+var router_context_1 = require("next/dist/shared/lib/router-context.shared-runtime");
var router_1 = require("next/router");
var react_1 = __importStar(require("react"));
var ntrData_1 = require("../shared/ntrData");
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch
next-translate-routes@1.10.2
for the project I'm working on.library next-translate-routes didnt work ,i got error like this ===>Module not found: Can't resolve 'next/dist/shared/lib/router-context' https://nextjs.org/docs/messages/module-not-found Import trace for requested module: ./node_modules/next-translate-routes/index.js ./pages/_app.tsx Using external babel configuration from /Users/bogdan/Documents/work/landing/.babelrc.js โจฏ ./node_modules/next-translate-routes/react/withTranslateRoutes.js:38:1 Module not found: Can't resolve 'next/dist/shared/lib/router-context' https://nextjs.org/docs/messages/module-not-found Import trace for requested module: ./node_modules/next-translate-routes/index.js ./pages/_app.tsx GET / 500 in 7289ms
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.