`resolve(...)` works incorrectly inside a remote function
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the bug
In a remote function, event.url.pathname is always / (because the actual pathname of the generated endpoint is an implementation detail that shouldn't be relied upon).
That means that resolve(...) will always return a pathname that's resolved from the root, which generally isn't what people intend, since they can't then use the pathname for anything useful.
We could fall back to non-relative resolution in this case, but that would cause breakage for people who rely on relative pathnames. Or we could just forbid its use altogether. Not sure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how resolve(...) uses event.url.pathname inside remote functions, where the pathname is always /. Compare the compatibility impact of non-relative fallback versus forbidding this use, then define and test the intended behavior for relative pathnames.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100