Netlify cli crashes anytime an error is thrown from an express route
Closed this issue · 2 comments
Describe the bug
Netlify cli crashes
Steps to reproduce
TypeError: Invalid URL
at new URL (node:internal/url:775:36)
at /Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/netlify/functions/render.ts:30:17
at Layer.handle [as handle_request] (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/route.js:149:13)
at Route.dispatch (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/route.js:119:3)
at Layer.handle [as handle_request] (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/layer.js:95:5)
at /Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/index.js:284:15
at Function.process_params (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/index.js:346:12)
at next (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/index.js:280:10)
at Function.handle (/Users/andrewaskins/Documents/Projects/Disco Shrimp/chartjuice/Code/chartjuice-functions/.netlify/functions-serve/render/node_modules/express/lib/router/index.js:175:3)
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M2
Binaries:
Node: 20.11.1 - /usr/local/bin/node
npm: 10.5.0 - /usr/local/bin/npm
Browsers:
Chrome: 125.0.6422.142
Safari: 17.5
npmGlobalPackages:
netlify-cli: 17.26.3
Configuration
[build]
command = "echo Building Functions"
functions = "netlify/functions"
publish = "public"
[functions]
node_bundler = "esbuild"
external_node_modules = ["express"]
[[redirects]]
force = true
from = "/*"
status = 200
to = "/.netlify/functions/render/:splat"
Environment
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M2
Memory: 646.44 MB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - /usr/local/bin/node
npm: 10.5.0 - /usr/local/bin/npm
npmGlobalPackages:
netlify-cli: 17.26.3
Netlify cli is crashing any time I have an error in my express route.
I wasn't properly handling my errors in express, cli is behaving as expected now https://expressjs.com/en/guide/error-handling.html