Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Rich-Harris
Copy link
Member

fixes #14513. (I also added a drive-by fix for the fact that non-relative resolution ignored paths.base.)

In the process of doing this, I realised that resolve(...) will give incorrect results when called in the context of a remote function, since the pathname is always / in that case. Not entirely sure how best to handle it — we should probably fall back to non-relative resolution in that case too? (Making it relative to the route from which the remote function was called isn't a solution, because then the result is non-deterministic and non-cacheable.)


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2025

🦋 Changeset detected

Latest commit: ddc328b

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit 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

@Jerboas86
Copy link

May i access parent path with resolve in relative path mode ?

I mean something like that

resolve("../foo")

If no, is it by design ?

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave a suggestion which solved the remote function case when called from the client - though not 100% ideal, so given this fixed a somewhat critical bug I'd say we merge this as is if you think the suggestion is incomplete

@Rich-Harris
Copy link
Member Author

May i access parent path with resolve in relative path mode

no, that's not what it's for. A relative path is the output, not the input

@Rich-Harris Rich-Harris merged commit 09d0961 into main Sep 25, 2025
22 checks passed
@Rich-Harris Rich-Harris deleted the gh-14513 branch September 25, 2025 17:45
@github-actions github-actions bot mentioned this pull request Sep 25, 2025
ryoppippi added a commit to ryoppippi/ryoppippi.com that referenced this pull request Sep 27, 2025
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.

When using 2.43.1 version of sveltejs/kit, I've got an internal runtime error.

4 participants