Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: basepath did not read from the environment variable (#24870)

17hzf11131f8b502
diff --git a/web/next.config.js b/web/next.config.js
index 6920a47fbf1..e039ba92841 100644
--- a/web/next.config.js
+++ b/web/next.config.js
@@ -1,4 +1,3 @@
-const { basePath, assetPrefix } = require('./utils/var-basePath')
const { codeInspectorPlugin } = require('code-inspector-plugin')
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
@@ -24,8 +23,7 @@ const remoteImageURLs = [hasSetWebPrefix ? new URL(`${process.env.NEXT_PUBLIC_WE
/** @type {import('next').NextConfig} */
const nextConfig = {
- basePath,
- assetPrefix,
+ basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
webpack: (config, { dev, isServer }) => {
if (dev) {
config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
diff --git a/web/utils/var-basePath.js b/web/utils/var-basePath.js
deleted file mode 100644
index ff6dd505ea5..00000000000
--- a/web/utils/var-basePath.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// export basePath to next.config.js
-// same as the one exported from var.ts
-module.exports = {
- basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
- assetPrefix: '',
-}
diff --git a/web/utils/var.ts b/web/utils/var.ts
index 4bbb7ca631e..e3320a099d4 100644
--- a/web/utils/var.ts
+++ b/web/utils/var.ts
@@ -118,7 +118,7 @@ export const getVars = (value: string) => {
// Set the value of basePath
// example: /dify
-export const basePath = ''
+export const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''
export function getMarketplaceUrl(path: string, params?: Record<string, string | undefined>) {
const searchParams = new URLSearchParams({ source: encodeURIComponent(window.location.origin) })