This commit is contained in:
hailin 2025-05-21 13:32:58 +08:00
parent 14cd36579b
commit 426d3181d8
1 changed files with 1 additions and 9 deletions

View File

@ -1,20 +1,12 @@
/*
eslint-disable @next/next/no-sync-scripts
Please do not remove:
We are enforcing synchronous loading of /env.js here to inject window.RUNTIME_ENV
to ensure dynamic configurations like Supabase are available before React starts.
*/
import { Html, Head, Main, NextScript } from "next/document";
import Script from "next/script";
export default function Document() {
return (
<Html lang="en">
<Head>
{/* Use next/script to load env.js synchronously */}
<Script
src="/env.js"
strategy="beforeInteractive" // Ensures the script loads before React starts
strategy="beforeInteractive" // 确保在 React 启动之前加载
/>
</Head>
<body>