Build: Resolve svelte config paths against the sandbox cwd in sandbox-parts#35130
Merged
Conversation
findFirstPath returns a path relative to the sandbox cwd, but getConfigFile passed it straight to readConfig, which resolved it against the script's own working directory. This broke the svelte and sveltekit create jobs on next with 'ENOENT: open svelte.config.js' / 'vite.config.ts' since #35127.
Sidnioulz
approved these changes
Jun 10, 2026
timothybrush
pushed a commit
to timothybrush/storybook
that referenced
this pull request
Jun 10, 2026
…e array The resolve/server injection matched the whole plugins array with [^\]]*, which cuts short at the first ']' — and the sveltekit template's runes regex /[/\\]/ contains one, so the injection landed inside the regex literal and produced an unparseable vite.config.ts (the build/dev failures on storybookjs#35130). Injecting the siblings before the plugins key never touches the array contents.
16 tasks
Merged
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
#35127 introduced
getConfigFile, which passes the relative filename returned byfindFirstPathstraight toreadConfig— so the path resolves against the script's own working directory instead of the sandbox. Since it merged, thesvelte-latest...createandsveltekit-latest...createjobs fail on every PR with:(e.g. on #35125: builds 1591247, 1591177)
The fix joins the sandbox cwd in
getConfigFile, matching the existingreadFile(join(sandboxDir, configFile))pattern elsewhere in the file.Manual testing
Ran
yarn task sandbox --template svelte-kit/skeleton-ts --start-from autowith the fix: sandbox creation passes the previously failing prepare step, and the generatedvite.config.tscontains the intendedcompilerOptions.experimental.asyncandexperimental.remoteFunctionsinjections.cc @Sidnioulz
Summary by CodeRabbit