You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new Next.js 15 project or use an existing one upgraded to Next.js 15.
Define a revalidate field with a mathematical expression in one of the route handlers. For example:
exportconstrevalidate=60*5;
Attempt to run or build the project.
Current vs. Expected behavior
Current:
npm run build
> build
> next build
▲ Next.js 15.0.3-canary.6
Creating an optimized production build ...
⨯ Next.js can't recognize the exported `config` field in route "/page":Unsupported node type "BinaryExpression" at "revalidate".Read More - https://nextjs.org/docs/messages/invalid-page-config ✓ Compiled successfully ✓ Linting and checking validity of types ⨯ Invalid config value exports detected, these can cause unexpected behavior from the configs not being applied. Please fix them to continue
Expected: The mathematical expression to be evaluated
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
Available memory (MB): 3921
Available CPU cores: 4
Binaries:
Node: 20.16.0
npm: 10.8.1
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 15.0.3-canary.6 // Latest available version is detected (15.0.3-canary.6).
eslint-config-next: N/A
react: 19.0.0-rc-7c8e5e7a-20241101
react-dom: 19.0.0-rc-7c8e5e7a-20241101
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
In Next.js 15, the revalidate field in route handlers does not support mathematical expressions (e.g. 60 * 5). This behavior was supported in Next.js 14, which accepted expressions that evaluated to integers.
Instead, Next.js 15 only supports direct integer values for revalidate.
eg.
exportconstrevalidate=300;// 60*5
The text was updated successfully, but these errors were encountered:
Link to the code that reproduces this issue
https://github.com/GitDevla/next_my_app
To Reproduce
Current vs. Expected behavior
Current:
Expected: The mathematical expression to be evaluated
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024 Available memory (MB): 3921 Available CPU cores: 4 Binaries: Node: 20.16.0 npm: 10.8.1 Yarn: N/A pnpm: N/A Relevant Packages: next: 15.0.3-canary.6 // Latest available version is detected (15.0.3-canary.6). eslint-config-next: N/A react: 19.0.0-rc-7c8e5e7a-20241101 react-dom: 19.0.0-rc-7c8e5e7a-20241101 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
In Next.js 15, the revalidate field in route handlers does not support mathematical expressions (e.g. 60 * 5). This behavior was supported in Next.js 14, which accepted expressions that evaluated to integers.
Instead, Next.js 15 only supports direct integer values for revalidate.
eg.
The text was updated successfully, but these errors were encountered: