title: Next getStaticPaths throws error: A required parameter (slug) was not provided as an array in getStaticPaths for /[[...slug]]
body: <p>I have NEXTjs connected to Strapi API. On my address http://localhost:1337/api/global?populate=* from where I get data with Axios in this format:</p>
  <pre><code>{
   &quot;data&quot;:
   {
    &quot;id&quot;:1,
    &quot;attributes&quot;:
     {
      &quot;Title&quot;:&quot;ESN Hradec Králové&quot;,
      &quot;links&quot;:
       [
        {&quot;id&quot;:7, &quot;name&quot;:&quot;Home&quot;, &quot;slug&quot;:&quot;/&quot;},
        {&quot;id&quot;:8, &quot;name&quot;:&quot;Exchange students&quot;, &quot;slug&quot;:&quot;/exchange&quot;},
        {&quot;id&quot;:9,&quot;name&quot;:&quot;Local students&quot;,&quot;slug&quot;:&quot;/local&quot;},
        {&quot;id&quot;:10,&quot;name&quot;:&quot;About us&quot;,&quot;slug&quot;:&quot;/about&quot;},            
        {&quot;id&quot;:11,&quot;name&quot;:&quot;Partners&quot;,&quot;slug&quot;:&quot;/partners&quot;}, 
        {&quot;id&quot;:12,&quot;name&quot;:&quot;FAQ&quot;,&quot;slug&quot;:&quot;/faq&quot;}
       ]
     }
    }
  }
  </code></pre>
  <p>My project structure is:</p>
  <pre><code>src/
  ├── components
  └── pages/
      ├── [[...slug]].tsx
      ├── _app.tsx
      └── _document.tsx
  </code></pre>
  <p>If I understand right the [[...slug]].tsx helps me with dynamic routing with use of <code>getStaticPaths()</code> and <code>getStaticProps()</code>.
  So my [[...slug]].tsx filu looks like this:</p>
  <pre><code>import React from 'react';
  import { NextPage } from 'next';
  
  const DynamicPage: NextPage = (props) =&gt; {
    console.log(props);
    return &lt;&gt;This is page&lt;/&gt;;
  };
  
  export const getStaticPaths = async () =&gt; {
    const { data: result } = await axios.get(`http://localhost:1337/api/global?populate=*`);
    const paths = result
      ? result.data.attributes?.links.map((link) =&gt; {
          return { params: { slug: link.slug } };
        })
      : [];
    return {
      paths,
      fallback: false,
    };
  };
  
  export const getStaticProps = async (context) =&gt; {
    const { slug } = context.params;
    
    return {
      props: {
        slug,
      },
    };
  };
  
  export default DynamicPage;
  </code></pre>
  <p>But this return an Error: <br/>
  <code>Error: A required parameter (slug) was not provided as an array in getStaticPaths for /[[...slug]]</code>
  <a href="https://i.stack.imgur.com/i4QLp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i4QLp.png" alt="Error" /></a></p>
  <p>What can I do to fix this error?
  I would appreciate any help.</p>