Skip to content

fix(observe): resolve a path that starts with // as a path - #753

Open
bryanlundberg wants to merge 2 commits into
solidjs:mainfrom
bryanlundberg:fix/752-double-slash-diagnostics
Open

bryanlundberg wants to merge 2 commits into
solidjs:mainfrom
bryanlundberg:fix/752-double-slash-diagnostics

Conversation

@bryanlundberg

Copy link
Copy Markdown

Fixes #752

With diagnostics: true, a request for // crashed the dev server: the observe tier resolved the location with new URL(to(), mockBase), and // is a protocol-relative URL with an empty host, so the constructor throws.

The three new URL(x, mockBase).pathname calls in factory.tsx now go through a small helper that prefixes mockBase to a path starting with /, the same way routing.ts already resolves locations. Only paths that start with // behave differently.

@changeset-bot

changeset-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b40916d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.0.1] diagnostics: a request for // crashes the dev server (Invalid URL in describeInitial)

1 participant