The site is: gifted-antelope-58b104.netlify.app
Here are the build logs for an example failing build.
I have a file-tree that looks like:
.
├── netlify.toml
├── package.json
├── packages
│ ├── discovery
│ │ ├── netlify.toml
│ │ ├── package.json
│ ├── frontend
│ │ ├── package.json
│ ├── hardhat
│ │ ├── package.json
│ ├── lib
│ │ ├── package.json
│ ├── pixel-art-react
│ │ ├── package.json
│ ├── social
│ │ ├── package.json
│ └── ui-components
│ ├── package.json
└── yarn.lock
I am deploying the discovery
package, using packages/discovery
as a base.
Notably, in packages/discovery/package.json
, we have a dependencies
entry
"@supercool/ui-components": "*"
And in packages/discovery/ui-components/package.json
we have another internal dependency:
"@supercool/lib": "*",
Everything works fine when I deploy with a cleared cached, but when I deploy with a cache, it cannot find the linked workspace dependencies.
- Working build: deployed with a cleared cache
- Failing build: deployed with a populated cache
The working build was deployed with a cleared cache. Then right after I pushed a non-consequential file change and the next build failed. If I clear the cache and retry, the build succeeds.
From the website, the build settings are:
- Base directory:
packages/discovery
- Build command:
yarn validate-env && yarn build
- Publish directory:
packages/discovery/.next
And my packages/discovery/netlify.toml
:
[build]
# postinstall package.json scripts don't run when the dependency is cached, so
# we need to manually call those commands when we build in Netlify.
command = "yarn validate-env && yarn build"
publish = "./.next"
[build.environment]
NETLIFY_USE_YARN = "true"
[[plugins]]
package = "@netlify/plugin-nextjs"
[context.beta-discovery]
[context.beta-discovery.environment]
NEXT_PUBLIC_APP_URL_SCHEME = "https"
NEXT_PUBLIC_APP_HOST = "discovery-beta.netlify.app"
NEXT_PUBLIC_APP_DOMAIN = "discovery-beta.netlify.app"
NEXT_PUBLIC_SUPABASE_URL = "https://gnqzipfybyrapoqfiqkj.supabase.co"
SUPABASE_URL = "https://gnqzipfybyrapoqfiqkj.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_PUBLIC_KEY = <redacted>
RECOMMENDER_MODEL_LOAD_FROM = "supabase"
RECOMMENDER_MODEL_STORAGE_PATH = "2022-05-30_similarity_rankings_15k.txt"
NEXT_PUBLIC_POSTHOG_API_KEY = <redacted>
# Define these in web UI
#
# SUPABASE_SERVICE_ROLE_KEY
# DATABASE_URL
# SIMPLEHASH_API_KEY
# Also, serverless functions that need to access variables at runtime (as
# opposed to build-time) need their environment variables defined in the UI.
# These are:
#
# RECOMMENDER_MODEL_LOAD_FROM
# RECOMMENDER_MODEL_STORAGE_PATH
Thanks for the help!