-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NextRouter was not mounted #1217
Comments
Im not using the |
This is my const { ALL_LOCALES, DEFAULT_LOCALE } = require("@shared/constants");
module.exports = {
locales: ALL_LOCALES,
defaultLocale: DEFAULT_LOCALE,
pages: {
"*": [
"common",
"pages",
"auth",
"errors",
"permissions",
"settings",
"toast",
"themes",
"billing",
"fields",
"models",
"validation",
],
},
loadLocaleFrom: async (locale, namespace) =>
import(`../../shared/translations/locales/${locale}/${namespace}`).then(
(r) => r.default,
),
}; |
And this is my /** @type {import('next').NextConfig} */
const nextTranslate = require("next-translate-plugin");
const { version } = require("./package.json");
const {
ALL_LOCALES,
DEFAULT_LOCALE,
ASSETS_BUCKET_1,
} = require("@shared/constants");
const nextConfig = {
i18n: {
locales: ALL_LOCALES,
defaultLocale: DEFAULT_LOCALE,
localeDetection: false,
},
publicRuntimeConfig: { version },
images: {
remotePatterns: [
{ protocol: "https", hostname: "res.cloudinary.com" },
{ protocol: "https", hostname: ASSETS_BUCKET_1 },
],
},
};
module.exports = (phase, { defaultConfig }) => {
const configWithTranslate = nextTranslate(nextConfig);
return configWithTranslate;
}; |
When I add |
Try |
Oh wow that actually solved it! Thank you very much @zaaakher ! |
That worked locally but the problem still exist in my github action workflow |
Actuallly now it's happening in other workspaces that I haven't touched in a while but they have |
Im getting the error And I can only fix the issue by commenting the line mentioned here #1217 (comment) @aralroca Could we possibily add a check if NextRouter is mounted or not? |
@TheMikeyRoss What's your |
They were |
Ok so I created an entirly new next.js app within my mono repo with the following next.config:
And I got the same error. When I remove nextTranslate HOC The error disappear and the build succeeds |
This works:const nextConfig = {
i18n: {
locales: ["ar", "en"],
defaultLocale: "ar",
},
};
export default nextConfig; This failsimport nextTranslate from "next-translate-plugin";
const nextConfig = {
i18n: {
locales: ["ar", "en"],
defaultLocale: "ar",
},
};
export default nextTranslate(nextConfig); |
I downgraded next.js from 14.2.3 to 14.2.2 and still the same issue |
I've deleted the entire repo and cloned it again and still get the same error |
@aralroca I tried using next-translate v |
I downgraded to |
I'm absolutely losing my mind |
You can use always put a band-aid with |
/pages directory
What version of this package are you using?
2.6.2
What operating system, Node.js, and npm version?
Windows 10
Node: 18.20.3
Npm: 10.7.0
What happened?
When i try to build my next.js app I get the following error (for each and every page)
What did you expect to happen?
It used to build the app with no issues
Are you willing to submit a pull request to fix this bug?
Definitely if I know the cause of the issue
The text was updated successfully, but these errors were encountered: