-
Notifications
You must be signed in to change notification settings - Fork 93
Description
Hi, I have a monorepo, with the website under apps/gatographql
. I have the following netlify.toml
:
[build]
command = "npm run build --prefix apps/gatographql"
publish = ".next"
The base is empty, as I use a single node_modules
for all apps.
For this website configuration, the package directory in the Build settings in Netlify has value apps/gatographql
:
apps/gatographql/package.json
has this content (notice there's a dependency to Next v14, for which the latest runtime, [email protected]
, is installed):
{
"scripts": {
"build": "next build"
},
"dependencies": {
"next": "^14.1.3"
}
}
I want to deploy the website using the CLI. When I run this command:
netlify deploy --build --context deploy-preview
I get this error:
Plugin "@netlify/plugin-nextjs" failed
────────────────────────────────────────────────────────────────
Error message
Error: Your publish directory was not found at: /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/.next. Please check your build settings
Plugin details
Package: @netlify/plugin-nextjs
Version: 5.8.1
Repository: git+https://github.com/netlify/next-runtime.git
npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
Report issues: https://github.com/netlify/next-runtime/issues
Error location
In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
Resolved config
build:
command: npm run build --prefix apps/gatographql
commandOrigin: config
environment:
- NODE_OPTIONS
publish: /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/.next
publishOrigin: config
The error is because the publish
directory is /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/.next
, however it should be /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/apps/gatographql/.next
(i.e., the apps/gatographql/
bit is missing).
Indeed, the folder under apps/gatographql/.next
was generated correctly during the build stage; then, during the deploy stage, it gets the path wrong.
I assume that's a bug.
I append the complete log at the bottom.
Btw, I have also tried with value publish = "apps/gatographql/.next"
in netlify.toml
.
In this case, I get a different error:
Plugin "@netlify/plugin-nextjs" failed
────────────────────────────────────────────────────────────────
Error message
Error: Failed publishing static content
Plugin details
Package: @netlify/plugin-nextjs
Version: 5.8.1
Repository: git+https://github.com/netlify/next-runtime.git
npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
Report issues: https://github.com/netlify/next-runtime/issues
Error location
In "onPostBuild" event in "@netlify/plugin-nextjs" from Netlify app
Resolved config
build:
base: /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/apps/gatographql
command: npm run build --prefix apps/gatographql
commandOrigin: config
environment:
- NODE_OPTIONS
publish: /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/apps/gatographql/apps/gatographql/.next
publishOrigin: config
Notice that, in this case, the publish
folder is now /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/apps/gatographql/apps/gatographql/.next
(apps/gatographql/
appears twice)
Complete log
This is the complete response from running netlify deploy --build --context deploy-preview
:
Netlify Build
────────────────────────────────────────────────────────────────
❯ Version
@netlify/build 29.36.3
❯ Flags
packagePath: apps/gatographql
❯ Current directory
/Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com
❯ Config file
/Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/apps/gatographql/netlify.toml
❯ Context
deploy-preview
❯ Using Next.js Runtime - v5.8.1
Cleaning up leftover files from previous builds
────────────────────────────────────────────────────────────────
(Pre cleanup completed in 13ms)
@netlify/plugin-nextjs (onPreBuild event)
────────────────────────────────────────────────────────────────
(@netlify/plugin-nextjs onPreBuild completed in 137ms)
build.command from netlify.toml
────────────────────────────────────────────────────────────────
$ npm run build --prefix apps/gatographql
> [email protected] build
> export $(cat .env | xargs) && NODE_OPTIONS=--max-old-space-size=8192 next build
▲ Next.js 14.1.3
- Environments: .env
Creating an optimized production build ...
Generated 379 documents in .contentlayer
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (230/230)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 31.9 kB 1.38 MB
├ ○ /_not-found 0 B 0 B
├ ○ /about 2.83 kB 124 kB
├ λ /api/deploy-algolia 0 B 0 B
├ ○ /architecture 174 B 84.8 kB
├ ● /architecture/[slug] 158 B 121 kB
├ ├ /architecture/cms-agnosticism
├ ├ /architecture/code-first
├ ├ /architecture/dataloading-engine
├ └ [+12 more paths]
├ ○ /blog 2.24 kB 1.31 MB
├ ● /blog/[slug] 1.52 kB 123 kB
├ ├ /blog/introducing-headless-wordpress-without-wordpress
├ ├ /blog/released-v70-to-power-standalone-plugins
├ ├ /blog/gatographql-gets-streamlined
├ └ [+46 more paths]
├ ○ /comparisons 4.6 kB 101 kB
├ ● /comparisons/[slug] 2.68 kB 124 kB
├ ├ /comparisons/gatographql-vs-wp-rest-api
├ └ /comparisons/gatographql-vs-wpgraphql
├ ○ /contact 3.27 kB 93 kB
├ ○ /demos 3.84 kB 1.31 MB
├ ● /demos/[slug] 6.46 kB 122 kB
├ ├ /demos/automatically-importing-new-posts-from-any-wordpress-rss-feed-daily
├ ├ /demos/automatically-sending-an-email-to-all-subscribers-notifying-of-a-new-post
├ ├ /demos/automatically-sync-post-featured-image-for-polylang
├ └ [+13 more paths]
├ ○ /developers 1.13 kB 122 kB
├ ○ /docs 174 B 84.8 kB
├ ○ /download 1.13 kB 122 kB
├ ○ /extensions 793 B 1.34 MB
├ ○ /extensions-reference 174 B 84.8 kB
├ λ /extensions-reference/[topic] 174 B 84.8 kB
├ ● /extensions-reference/[topic]/[slug] 158 B 121 kB
├ ● /extensions/[slug] 4.89 kB 1.34 MB
├ ├ /extensions/access-control
├ ├ /extensions/caching
├ ├ /extensions/custom-endpoints
├ └ [+7 more paths]
├ ○ /extensions/opengraph-image-1ptgva.png 0 B 0 B
├ ○ /extensions/twitter-image-1ptgva.png 0 B 0 B
├ ○ /features 2.38 kB 98.9 kB
├ ● /features/[slug] 7.38 kB 123 kB
├ ├ /features/access-control
├ ├ /features/api-hierarchy-and-endpoint-management
├ ├ /features/custom-endpoints
├ └ [+12 more paths]
├ ○ /features/opengraph-image-q698t4.png 0 B 0 B
├ ○ /features/twitter-image-q698t4.png 0 B 0 B
├ ○ /guides 174 B 84.8 kB
├ λ /guides/[topic] 174 B 84.8 kB
├ ● /guides/[topic]/[slug] 158 B 121 kB
├ ○ /highlights 4.26 kB 134 kB
├ ○ /howdy 5.48 kB 121 kB
├ ○ /library 174 B 84.8 kB
├ ● /library/[slug] 158 B 121 kB
├ ├ /library/add-a-mandatory-comments-block-to-post
├ ├ /library/add-missing-links-in-post
├ ├ /library/augment-data-from-an-external-api
├ └ [+49 more paths]
├ ○ /newsletter 3.75 kB 93.5 kB
├ ○ /opengraph-image.png 0 B 0 B
├ ○ /pricing 395 B 1.32 MB
├ ○ /refund-policy 6.13 kB 122 kB
├ ○ /robots.txt 0 B 0 B
├ ○ /shop 174 B 84.8 kB
├ ○ /shop/customer-portal 158 B 121 kB
├ ○ /shop/my-orders 158 B 121 kB
├ ○ /shop/success 1.13 kB 122 kB
├ ○ /sitemap.xml 0 B 0 B
├ ○ /slides 174 B 84.8 kB
├ ○ /slides/cover 3.66 kB 93.4 kB
├ λ /slides/extension-cover/[slug] 4.15 kB 93.9 kB
├ ○ /specials 174 B 84.8 kB
├ ○ /specials/wpbuilds 158 B 121 kB
├ ○ /support 3.12 kB 92.8 kB
├ ○ /tutorial 174 B 84.8 kB
├ ● /tutorial/[slug] 158 B 121 kB
├ ├ /tutorial/adapting-content-in-bulk
├ ├ /tutorial/automatically-adding-a-mandatory-block
├ ├ /tutorial/automatically-sending-newsletter-subscribers-from-instawp-to-mailchimp
├ └ [+26 more paths]
└ ○ /twitter-image.png 0 B 0 B
+ First Load JS shared by all 84.7 kB
├ chunks/1dd3208c-150aa526550611f4.js 53.4 kB
├ chunks/9997-9539fc6784a82a39.js 29.2 kB
└ other shared chunks (total) 2.07 kB
○ (Static) prerendered as static content
● (SSG) prerendered as static HTML (uses getStaticProps)
λ (Dynamic) server-rendered on demand using Node.js
(build.command completed in 28.6s)
@netlify/plugin-nextjs (onBuild event)
────────────────────────────────────────────────────────────────
@netlify/plugin-nextjs (onEnd event)
────────────────────────────────────────────────────────────────
(@netlify/plugin-nextjs onEnd completed in 6ms)
Save updated config
────────────────────────────────────────────────────────────────
(options.onEnd completed in 4ms)
Plugin "@netlify/plugin-nextjs" failed
────────────────────────────────────────────────────────────────
Error message
Error: Your publish directory does not contain expected Next.js build output. Please check your build settings
Plugin details
Package: @netlify/plugin-nextjs
Version: 5.8.1
Repository: git+https://github.com/netlify/next-runtime.git
npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
Report issues: https://github.com/netlify/next-runtime/issues
Error location
In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
Resolved config
build:
command: npm run build --prefix apps/gatographql
commandOrigin: config
environment:
- NODE_OPTIONS
publish: /Users/leo/GitRepos/GitHub/Sites/leoloso/gatographql.com/.next
publishOrigin: config
plugins:
- inputs: {}
origin: ui
package: '@netlify/plugin-nextjs'
redirects:
- from: /gatographql-vs-wprestapi
status: 301
to: /comparisons/gatographql-vs-wp-rest-api
- from: /gatographql-vs-wp-rest-api
status: 301
to: /comparisons/gatographql-vs-wp-rest-api
- from: /gatographql-vs-wpgraphql
status: 301
to: /comparisons/gatographql-vs-wpgraphql
- from: /tags
status: 301
to: /blog
- from: /tags/*
status: 301
to: /blog
- from: /recipes/*
status: 301
to: /tutorial/:splat
- from: /demo
status: 301
to: /tutorial/intro
- from: /about-us
status: 301
to: /about
- from: /guides/special-features/*
status: 301
to: /features/:splat
- from: /guides/intro
status: 301
to: /guides/intro/intro-to-graphql-and-gato-graphql
- from: /guides/query
status: 301
to: /guides/query/executing-queries-and-mutations
- from: /guides/use
status: 301
to: /guides/use/creating-a-custom-endpoint
- from: /guides/schema
status: 301
to: /guides/schema/namespacing-the-schema
- from: /guides/config
status: 301
to: /guides/config/installing-and-upgrading-a-bundle-or-extension
- from: /guides/augment
status: 301
to: /guides/augment/schema-extensions-via-introspection
- from: /guides/interact
status: 301
to: /guides/interact/working-with-custom-posts
- from: /guides/deep
status: 301
to: /guides/deep/fetching-dynamically-structured-data
- from: /guides/resources
status: 301
to: /guides/resources/graphql-best-practices
- from: /tutorial/complementing-wp-cli
status: 301
to: /guides/code/complementing-wp-cli
- from: /tutorial/dry-code-for-blocks-in-javascript-and-php
status: 301
to: /guides/code/dry-code-for-blocks-in-javascript-and-php
- from: /tutorial/exposing-public-and-private-endpoints
status: 301
to: /guides/code/exposing-public-and-private-endpoints
- from: /tutorial/feeding-data-to-blocks-in-the-editor
status: 301
to: /guides/code/feeding-data-to-blocks-in-the-editor
- from: /tutorial/injecting-multiple-resources-into-wp-cli
status: 301
to: /guides/code/injecting-multiple-resources-into-wp-cli
- from: /tutorial/mapping-js-components-to-gutenberg-blocks
status: 301
to: /guides/code/mapping-js-components-to-gutenberg-blocks
- from: /bundles
status: 301
to: /
- from: /bundles/all-in-one-toolbox-for-wordpress
status: 301
to: /
- from: /bundles/automated-content-translation-and-sync-for-wordpress-multisite
status: 301
to: /
- from: /bundles/better-wordpress-webhooks
status: 301
to: /
- from: /bundles/easy-wordpress-bulk-transform-and-update
status: 301
to: /
- from: /bundles/private-graphql-server-for-wordpress
status: 301
to: /
- from: /bundles/responsible-wordpress-public-api
status: 301
to: /
- from: /bundles/selective-content-import-export-and-sync-for-wordpress
status: 301
to: /
- from: /bundles/simplest-wordpress-content-translation
status: 301
to: /
- from: /bundles/tailored-wordpress-automator
status: 301
to: /
- from: /bundles/unhindered-wordpress-email-notifications
status: 301
to: /
- from: /bundles/versatile-wordpress-request-api
status: 301
to: /
- from: /bundles/content-translation
status: 301
to: /
- from: /bundles/public-api
status: 301
to: /
- from: /bundles/application-glue-and-automator
status: 301
to: /
- from: /bundles/all-extensions
status: 301
to: /
- from: /raffle
status: 302
to: /
- from: /black-friday
status: 302
to: /
- from: /wpbuilds
status: 301
to: /specials/wpbuilds
- from: /docs/dynamic-schema/ifttt-through-directives.html
status: 301
to: /architecture/ifttt-through-directives
- from: /docs/dynamic-schema/field-directive-based-versioning.html
status: 301
to: /architecture/field-directive-based-versioning
- from: /docs/architecture/cms-agnosticism.html
status: 301
to: /architecture/cms-agnosticism
- from: /docs/architecture/solid.html
status: 301
to: /architecture/solid
- from: /docs/architecture/code-first.html
status: 301
to: /architecture/code-first
- from: /docs/architecture/dataloading-engine.html
status: 301
to: /architecture/dataloading-engine
- from: /docs/architecture/decoupling-queries.html
status: 301
to: /architecture/decoupling-queries
- from: /docs/architecture/directive-design.html
status: 301
to: /architecture/directive-design
- from: /docs/architecture/directive-pipeline.html
status: 301
to: /architecture/directive-pipeline
- from: /docs/architecture/manipulating-field-resolution-order.html
status: 301
to: /architecture/manipulating-field-resolution-order
- from: /docs/architecture/nested-mutations-single-source-of-code.html
status: 301
to: /architecture/nested-mutations-single-source-of-code
- from: /docs/architecture/schema-type-directives.html
status: 301
to: /architecture/schema-type-directives
- from: /docs/architecture/subscribing-fields-to-types.html
status: 301
to: /architecture/subscribing-fields-to-types
- from: /docs/architecture/suppressing-n-plus-one-problem.html
status: 301
to: /architecture/suppressing-n-plus-one-problem
- from: /docs/architecture/using-components-instead-of-graphs.html
status: 301
to: /architecture/using-components-instead-of-graphs
- from: /guides/rapid-iteration-on-the-schema.html
status: 301
to: /
- from: /guides/versioning-fields-and-directives.html
status: 301
to: /features/field-and-directive-based-versioning
- from: /guides/localized-newsletter.html
status: 301
to: /
- from: /guides/building-cms-agnostic-api.html
status: 301
to: /architecture/cms-agnosticism
- from: /docs/architecture/*
status: 301
to: /
- from: /docs/caching/*
status: 301
to: /
- from: /docs/clients/*
status: 301
to: /
- from: /docs/dynamic-schema/*
status: 301
to: /
- from: /docs/extended/*
status: 301
to: /
- from: /docs/getting-started/*
status: 301
to: /
- from: /docs/going-further/*
status: 301
to: /
- from: /docs/operational/*
status: 301
to: /
- from: /docs/roadmap/*
status: 301
to: /
- from: /docs/schema-objects/*
status: 301
to: /
- from: /docs/troubleshooting/*
status: 301
to: /
- from: /library/import-post-from-wp-rss-feed
status: 301
to: /library/import-post-from-wordpress-rss-feed
- from: /library/import-post-from-wp-site
status: 301
to: /library/import-post-from-wordpress-site
- from: /library/export-post-to-wp-site
status: 301
to: /library/export-post-to-wordpress-site
- from: /features/graphical-clients
status: 301
to: /features/interactive-clients-and-user-interface
- from: /features/graphiql-client
status: 301
to: /features/interactive-clients-and-user-interface
- from: /features/voyager-client
status: 301
to: /features/interactive-clients-and-user-interface
- from: /features/predefined-persisted-queries
status: 301
to: /features
- from: /features/sensitive-data
status: 301
to: /features/security
- from: /features/enhanced-security
status: 301
to: /features/security
- from: /features/api-hierarchy
status: 301
to: /features/api-hierarchy-and-endpoint-management
- from: /features/endpoint-management
status: 301
to: /features/api-hierarchy-and-endpoint-management
- from: /features/schema-namespacing
status: 301
to: /features/custom-features
- from: /features/global-fields
status: 301
to: /features/custom-features
- from: /features/field-to-input
status: 301
to: /features/custom-features
- from: /features/composable-directives
status: 301
to: /features/custom-features
- from: /features/multifield-directives
status: 301
to: /features/custom-features
- from: /features/field-and-directive-based-versioning
status: 301
to: /features/custom-features
- from: /features/proactive-feedback
status: 301
to: /features/custom-features
- from: /features/public-private-schema
status: 301
to: /features/access-control
- from: /features/function-fields
status: 301
to: /features/schema-functions
- from: /features/function-directives
status: 301
to: /features/schema-functions
- from: /features/http-client
status: 301
to: /features/schema-functions
- from: /features/helper-fields
status: 301
to: /features/schema-functions
- from: /features/environment-fields
status: 301
to: /features/schema-functions
- from: /features/mutation-return-type
status: 301
to: /features
- from: /features/automation
status: 301
to: /features
- from: /features/integrations-with-3rdparty-plugins
status: 301
to: /features
redirectsOrigin: config