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

"out" directory does not exist #373

Closed
gragland opened this issue May 31, 2021 · 3 comments
Closed

"out" directory does not exist #373

gragland opened this issue May 31, 2021 · 3 comments
Labels
priority: medium type: bug code to address defects in shipped code

Comments

@gragland
Copy link

gragland commented May 31, 2021

Describe the bug
When attempting to deploy manually with netlify deploy I get the error:

Error: No such directory /Users/gaberagland/projects/next-netlify/out! Did you forget to run a build?

It appears this is because next build stores all build files in the .next directory, not out. The out directory is only generated when running next export, but the readme specifically says not to use next export.

To Reproduce
Steps to reproduce the behavior:

  1. Start a new Next.js project
  2. Add the netlify.toml file from the readme
  3. Make sure the build script in your package.json calls next build
  4. Run npm run build
  5. Run netlify deploy

Versions

  • Next.js: 10.2.3
  • plugin (if installed at fixed version): 3.3.1

If you're using the CLI to build

  • OS: [e.g. macOS, Windows] macOS
  • netlify/cli version: 3.31.16

If you're using file-based installation

  • netlify.toml:
[build]
  command = "npm run build"
  publish = "out"

[[plugins]]
  package = "@netlify/plugin-nextjs"
@saidattax
Copy link

I got this error too, then realized deploying manually doesn't work. It works only when connected to a git repository

@lindsaylevine lindsaylevine added priority: medium type: bug code to address defects in shipped code labels Jun 1, 2021
@lindsaylevine
Copy link

lindsaylevine commented Jun 1, 2021

hey @gragland @saidattax. are you running netlify build or netlify deploy --build before netlify deploy or netlify deploy --prod? this step actually runs the build process locally (including running the plugin). netlify build or netlify deploy --build is a prerequisite to deploying locally when using any plugin. if this ends up fixing your problem, please do let us know how we can improve our README/docs so this is clearer!

@gragland
Copy link
Author

gragland commented Jun 2, 2021

Thanks @lindsaylevine! The issue was that I was running npm run build before deployment, not netlify deploy --build.

@gragland gragland closed this as completed Jun 2, 2021
serhalp pushed a commit that referenced this issue Apr 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* test: repro EEXIST

* fix: create server handler in sequential steps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants