mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Some checks failed
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
Updates `examples/demo` to Next.js 15 and adds Next.js 15 support to `packages/stack`. The other packages and apps are still running on Next.js 14 to ensure compatibility.
11 lines
773 B
TypeScript
11 lines
773 B
TypeScript
export const isReactServer = true;
|
|
|
|
|
|
// In Next.js 15, the `next/headers` module returns async functions.
|
|
// Since we support both Next.js 14 and 15, we return a union of the two.
|
|
// TODO: Remove this once we drop support for Next.js 14, and replace it with `export { cookies, headers } from 'next/headers';`
|
|
// https://nextjs.org/blog/next-15#async-request-apis-breaking-change
|
|
import { cookies as nextCookies, headers as nextHeaders } from './next-static-analysis-workaround';
|
|
export const cookies = nextCookies as typeof nextCookies | ((...args: Parameters<typeof nextCookies>) => Promise<ReturnType<typeof nextCookies>>);
|
|
export const headers = nextHeaders as typeof nextHeaders | ((...args: Parameters<typeof nextHeaders>) => Promise<ReturnType<typeof nextHeaders>>);
|