This commit is contained in:
parent
14cd36579b
commit
426d3181d8
|
|
@ -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";
|
import Script from "next/script";
|
||||||
|
|
||||||
export default function Document() {
|
export default function Document() {
|
||||||
return (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head>
|
<Head>
|
||||||
{/* Use next/script to load env.js synchronously */}
|
|
||||||
<Script
|
<Script
|
||||||
src="/env.js"
|
src="/env.js"
|
||||||
strategy="beforeInteractive" // Ensures the script loads before React starts
|
strategy="beforeInteractive" // 确保在 React 启动之前加载
|
||||||
/>
|
/>
|
||||||
</Head>
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue