Skip to content

TypeError: Missing parameter name #4981

@Haztry

Description

@Haztry

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

C:\...\node_modules\path-to-regexp\dist\index.js:73
            throw new TypeError(`Missing parameter name at ${i}: ${DEBUG_URL}`);
                  ^

TypeError: Missing parameter name at 10: https://git.new/pathToRegexpError

Screenshot

When using a wildcard route like app.get("/modules/", ...) in Express, I occasionally encounter an error. The error occurs even though the route syntax seems valid. Using a named parameter with a wildcard (:path()) also sometimes fails depending on route ordering with express.static.

Image

Environment data

PS Version: 5.1.19041.6456
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 225
BufferHeight: 47

Steps to reproduce

node .\server.js

Expected behavior

Express should serve the requested file or 404 if missing.

Actual behavior

path-to-regexp throws a TypeError: Missing parameter name instead of serving the file.

Wildcard route fails even with :path(*) in some cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions