fix: env var exposed in next.config are undefined

This commit is contained in:
Sonny
2023-11-12 05:34:15 +01:00
parent f5c406a84c
commit 11ac5f4b05
3 changed files with 3 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ MYSQL_DATABASE="mylinks"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_URL_INTERNAL="http://localhost:3000"
NEXT_PUBLIC_API_URL="http://localhost:3000/api"
NEXTAUTH_SECRET=""

View File

@@ -20,13 +20,7 @@ const config = {
formats: ["image/webp"]
},
reactStrictMode: false,
experimental: {
webpackBuildWorker: true
},
output: "standalone",
env: {
baseUrl: process.env.NEXTAUTH_URL
}
output: "standalone"
};
module.exports = config;

View File

@@ -1,3 +1,3 @@
export function faviconLinkBuilder(origin: string) {
return `${process.env.baseUrl}/api/favicon?url=${origin}`;
return `${process.env.NEXT_PUBLIC_API_URL}/favicon?url=${origin}`;
}