Skip to content

URL version parsing fails for major/major.minor patterns #3762

@Hugo-RM

Description

@Hugo-RM

p5.js version

No response

What is your operating system?

Windows

Web browser and version

No response

Actual Behavior

Fails to load when trying to pass in major/major.minor patterns. (?version=1 and ?version=2.1)

Loads default version when given ?version=2.1.2.

This occurs because the p5Versions array in common/p5Versions.js now contains objects rather than simply strings. The parser was not made to handle this and needs to be updated.

Expected Behavior

The most recent version that matches the major or major.minor should successfully be set up when valid prefixes are inputted. Should default to default version when invalid version is passed in.

As of December 18, 2025:

  • ?version=2.1 -> 2.1.2
  • ?version=1 -> 1.11.11
  • ?version=9 -> 1.11.11

Steps to reproduce

Try to configure version using either the major or major.minor pattern in the URL. I also put some examples below.

Example URLs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting Maintainer ApprovalNeeds review from a maintainer before moving forwardBugError or unexpected behaviors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions