<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PageProps Type Errors in Next.js. Type &#x27;{ slug: string; }&#x27; is missing the following properties from type &#x27;Promise&lt;any&gt;&#x27;]]></title><description><![CDATA[<p dir="auto">После обновления  Next js  до 15  версии,  в динамических маршрутах разработчики некоторые изменения, что приведет к ошибкам при сборке проекта.</p>
<p dir="auto">пример:</p>
<pre><code>Type error: Type 'Props' does not satisfy the constraint 'PageProps'.
  Types of property 'params' are incompatible.
    Type '{ slug: string; }' is missing the following properties from type 'Promise&lt;any&gt;': then, catch, finally, [Symbol.toStringTag]
</code></pre>
<p dir="auto">Разработчики сделали динамические параметры асинхронными, поэтому нужно будет поменять типы, и  получать их мы должны, например, через <code>await</code></p>
<p dir="auto">до 15 версии:</p>
<pre><code class="language-ts">
// СТАРЫЙ КОД
type Props = {
  params: {
    slug: string;
  };
};   

export async function generateMetadata({ params: { slug } }: Props) {
  const { category } = await fetchData(slug);

  ...
  }
}

export default async function Page({ params: { slug } }: Props) {
  const  data = await fetchData(slug);

  ...
}
</code></pre>
<p dir="auto">после 15 версии:</p>
<pre><code class="language-ts">// НОВЫЙ КОД
type Props = {
  params: Promise&lt;{
    slug: string;
  }&gt;;
};  

export async function generateMetadata(props: Props) {
  const { slug } = await props.params;
  const { category } = await fetchData(slug);
  ...
  }
}

export default async function Page(props: Props) {
  const { slug } = await props.params;
  const  data = await fetchData(slug);
  ...
}
</code></pre>
<p dir="auto"><a href="https://nextjs.org/docs/app/building-your-application/upgrading/version-15" target="_blank" rel="noopener noreferrer">Источник</a></p>
]]></description><link>https://forum.exlends.ru/topic/30/pageprops-type-errors-in-next-js-type-slug-string-is-missing-the-following-properties-from-type-promise-any</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 08:57:14 GMT</lastBuildDate><atom:link href="https://forum.exlends.ru/topic/30.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Oct 2024 12:01:44 GMT</pubDate><ttl>60</ttl></channel></rss>