Skip to content

Commit ddc27a7

Browse files
authored
warn users about nextjs version (#5045)
* warn users about nextjs version * dang it darglint
1 parent 321545c commit ddc27a7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

reflex/constants/installer.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ class Node(SimpleNamespace):
6868
MIN_VERSION = "18.18.0"
6969

7070

71+
def _determine_nextjs_version() -> str:
72+
default_version = "15.2.4"
73+
if (version := os.getenv("NEXTJS_VERSION")) and version != default_version:
74+
from reflex.utils import console
75+
76+
console.warn(
77+
f"You have requested next@{version} but the supported version is {default_version}, abandon all hope ye who enter here."
78+
)
79+
return version
80+
return default_version
81+
82+
7183
class PackageJson(SimpleNamespace):
7284
"""Constants used to build the package.json file."""
7385

@@ -85,7 +97,7 @@ class Commands(SimpleNamespace):
8597
"@emotion/react": "11.14.0",
8698
"axios": "1.8.3",
8799
"json5": "2.2.3",
88-
"next": os.getenv("NEXTJS_VERSION", "15.2.4"),
100+
"next": _determine_nextjs_version(),
89101
"next-sitemap": "4.2.3",
90102
"next-themes": "0.4.6",
91103
"react": "19.0.0",

0 commit comments

Comments
 (0)