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

A index page using unstable_getStaticProps cannot be built #8843

Closed
Timer opened this issue Sep 24, 2019 · 1 comment · Fixed by #8846
Closed

A index page using unstable_getStaticProps cannot be built #8843

Timer opened this issue Sep 24, 2019 · 1 comment · Fixed by #8846
Milestone

Comments

@Timer
Copy link
Member

Timer commented Sep 24, 2019

Using the following:

// pages/index.js
import Link from 'next/link'

export function unstable_getStaticProps() {
  return { props: { foo: 'bar' } }
}

export default props => (
  <div>
    Hello World. {JSON.stringify(props)}
    <Link href="/about">
      <a>About</a>
    </Link>
  </div>
)

The next build command fails:

❯ yarn next build examples/hello-world                                              ✘ 130 
yarn run v1.17.3
$ ./packages/next/dist/bin/next build examples/hello-world
Creating an optimized production build  

Compiled successfully.

> Build error occurred
{ [Error: ENOENT: no such file or directory, rename '/Users/joe/Documents/Development/Work/zeit/next.js/examples/hello-world/.next/export/.json' -> '/Users/joe/Documents/Development/Work/zeit/next.js/examples/hello-world/.next/server/static/CQ1rxkGo8tNQfpJlNNxjA/pages/.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'rename',
  path:
   '/Users/joe/Documents/Development/Work/zeit/next.js/examples/hello-world/.next/export/.json',
  dest:
   '/Users/joe/Documents/Development/Work/zeit/next.js/examples/hello-world/.next/server/static/CQ1rxkGo8tNQfpJlNNxjA/pages/.json' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@Timer Timer added this to the 9.0.7 milestone Sep 24, 2019
@Timer Timer changed the title A page using unstable_getStaticProps cannot be built A index page using unstable_getStaticProps cannot be built Sep 24, 2019
@ijjk ijjk mentioned this issue Sep 24, 2019
@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 31, 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

Successfully merging a pull request may close this issue.

2 participants