path-to-regexp 🟩 Node.js

TypeError: Missing parameter name at 1 (path-to-regexp)

An Express 5 (path-to-regexp v8) route uses old wildcard syntax like '*' or '/:id?'.

Seen on: Node.js

Meaning

Express 5 changed path syntax: wildcards must be named ('/*splat'), optional params use braces ('/{:id}'), and special characters in paths need escaping.

Common causes

  • app.get('*', …) or '/api/*' in Express 5
  • Optional parameters with ?
  • Upgraded to Express 5 or a library using path-to-regexp 8

⚡ Quick fix

  1. Use named wildcards: app.get('/*splat', …)
  2. Optional segments: '/users{/:id}'
  3. Check the Express 5 migration guide

Detailed fix by platform

Node.js

  1. app.get('/*splat', (req, res) => res.sendFile(indexHtml));

How to diagnose

  1. Route — Which path string?
  2. Version — Express 5?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.