From 1a6612a25f511ed24d2a30524b2d3722c06d218f Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Wed, 20 Dec 2023 13:28:35 +0330 Subject: [PATCH] fixed bug globalServerProps --- src/core/utils/globalServerProps.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/utils/globalServerProps.js b/src/core/utils/globalServerProps.js index ef8e1b8..dffb0f2 100644 --- a/src/core/utils/globalServerProps.js +++ b/src/core/utils/globalServerProps.js @@ -1,10 +1,13 @@ import {parse} from "next-useragent"; +import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss"; export const globalServerProps = async ({req, locale}) => { const {isBot} = parse(req.headers["user-agent"]); + const responseConfig = await fetch(process.env.NEXT_PUBLIC_CONFIG_APP_URL); + return { - config: (await import(`&/config.json`)).default, + config: await responseConfig.json(), messages: (await import(`&/locales/${locale}/app.json`)).default, isBot, locale,