Edge Functions are not deployed
Describe the bug
When I run:
NETLIFY_SITE_ID=... netlify deploy --prod
The edge function is not deployed, the rest of the site deployed correctly. This issue happens with any @netlify/cli 16.x or 17.x, while 15.x is ok.
Steps to reproduce
Run:
NETLIFY_SITE_ID=... netlify deploy --prod
Configuration
[build]
base = "dist"
publish = "html"
edge_functions = "functions"
[[edge_functions]]
path = "/"
function = "events-injector"
cache = "manual"
[[headers]]
for = "*.png"
[headers.values]
Cache-Control = "public, s-maxage=31536000, max-age=31536000"
[[headers]]
for = "*.webp"
[headers.values]
Cache-Control = "public, s-maxage=31536000, max-age=31536000"
[[headers]]
for = "*.woff2"
[headers.values]
Cache-Control = "public, s-maxage=31536000, max-age=31536000"
[[headers]]
for = "*.json"
[headers.values]
Cache-Control = "public, s-maxage=31536000, max-age=31536000"
[[headers]]
for = "*.js"
[headers.values]
Cache-Control = "public, s-maxage=31536000, max-age=31536000"
[[headers]]
for = "sw.js"
[headers.values]
Cache-Control = "s-maxage=0, max-age=0, no-cache, no-store, must-revalidate"
Environment
System:
OS: macOS 14.2.1
CPU: (12) arm64 Apple M2 Max
Memory: 12.13 GB / 64.00 GB
Shell: 3.6.0 - /opt/homebrew/bin/fish
Binaries:
Node: 20.8.0 - /usr/local/bin/node
Yarn: 1.22.21 - /usr/local/bin/yarn
npm: 10.1.0 - /usr/local/bin/npm
pnpm: 8.13.1 - /usr/local/bin/pnpm
npmGlobalPackages:
netlify-cli: 17.13.0
$ find dist/
# dist/
# dist//html
# dist//html/index.html
# ...
# dist//functions
# dist//functions/events-injector.js
Any update on this?
Hi @ShogunPanda,
You can ask for help with usage of Netlify and the Netlify CLI over in our forums: https://answers.netlify.com/
In this specific case, try running NETLIFY_SITE_ID=... netlify deploy --build --prod and see if that makes it work with recent versions of the CLI. If not, please ask over in the forums and you'll get answers more quickly there.
@ramonsnir I tried and nothing changed.
Instead, I noticed that if I run cd dist && NETLIFY_SITE_ID=... netlify deploy --build --prod it works instead.
Anyway, I created the thread https://answers.netlify.com/t/edge-functions-are-not-deployed/113900
For anybody running into this. This has been solved in https://answers.netlify.com/t/edge-functions-are-not-deployed/113900/12
The key is to add a dummy command in the build section.
Like:
[build]
# ...
command = "true"
# ...