Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getStaticPaths builds the wrong data files with [...params] #10689

Closed
stefanoverna opened this issue Feb 25, 2020 · 3 comments
Closed

getStaticPaths builds the wrong data files with [...params] #10689

stefanoverna opened this issue Feb 25, 2020 · 3 comments

Comments

@stefanoverna
Copy link

Bug report

Describe the bug

With getStaticPaths, next build builds the wrong data files when using splat parameters [...params].

To Reproduce

Inside this route /foo/[...chunks]/index.js write the following:

export const unstable_getStaticPaths = async () => {
  return [
    { params: { chunks: ['a', 'b'] } },
  ]
}

export const unstable_getStaticProps = async ({ params: { chunks } }) => {
  // do stuff with chunks
}

// your page component

When running next build the data file created is:

_next/data/XXXX/foo/a%2Fb.json

while it should have been:

_next/data/XXXX/foo/a/b.json.

When browsing the site on ZEIT, the data file is ignored, and _next/data/XXXX/foo/a/b.json gets created instead.

System information

  • Version of Next.js: 9.2.1
@ijjk
Copy link
Member

ijjk commented Feb 25, 2020

Hi, this looks to be related to #10379 which is available in the latest canary of Next.js v9.2.3-canary.12

@stefanoverna
Copy link
Author

Confirmed! Thanks @ijjk!

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants