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

When Turbo is detected during build, output directory no longer falls back to . if public does not exist #11318

Closed
unitof opened this issue Mar 21, 2024 · 2 comments

Comments

@unitof
Copy link
Contributor

unitof commented Mar 21, 2024

When Vercel detects a Turborepo (containing build pipeline), the Output Directory no longer falls back to . if public does not exist after build.

I have a minimal reproducible repo which is simply a Turborepo with a single app, which is nothing but a static index.html page: https://github.com/yescomment/vc-mre-turbooutputbug/. Deploy it to Vercel with a root directory of ./apps/static-html.

No Turbo detected (example public deployment)

When the build key is removed from turbo.json, the app deploys without error, as the static site has no public directory, so falls back to serving .:

Turbo detected (example public deployment)

When even an empty build key is added to turbo.json, the static app encounters the build error:

Error: No Output Directory named "public" found after the Build completed. You can configure the Output Directory in your Project Settings.

…even though the Output Directory setting continues to display `public` if it exists, or `.`
Screenshot 2024-03-21 at 6 56 51 PM

Perhaps this a documented default behavior of Turborepo? However I think the Output Directory placeholder value should update to show that . will no longer be automatically used if public does not exist.

@unitof
Copy link
Contributor Author

unitof commented Mar 21, 2024

Note that overriding the outputDirectory to . also works, when Turbo is detected.

@anthonyshew
Copy link

Just looking quickly I see a few problems:

  1. This turbo.json doesn't cache anything. You need an outputs key so that turbo knows what to restore from cache if/when it hits cache.
  2. In your issue you wrote "Deploy it to Vercel with a root directory of ./apps/static-html" - but I don't see a directory of ./apps/static-html in your repository. Was this a typo and you meant ./apps/static-site? That directory is in the repository. If a Root Directory is set that isn't there, I would expect problems. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants