Skip to content

Build: Resolve svelte config paths against the sandbox cwd in sandbox-parts#35130

Merged
Sidnioulz merged 1 commit into
nextfrom
kasper/fix-svelte-sandbox-config-path
Jun 10, 2026
Merged

Build: Resolve svelte config paths against the sandbox cwd in sandbox-parts#35130
Sidnioulz merged 1 commit into
nextfrom
kasper/fix-svelte-sandbox-config-path

Conversation

@kasperpeulen

@kasperpeulen kasperpeulen commented Jun 10, 2026

Copy link
Copy Markdown
Member

What I did

#35127 introduced getConfigFile, which passes the relative filename returned by findFirstPath straight to readConfig — so the path resolves against the script's own working directory instead of the sandbox. Since it merged, the svelte-latest...create and sveltekit-latest...create jobs fail on every PR with:

Error: ENOENT: no such file or directory, open 'svelte.config.js'   (prepareSvelteSandbox)
Error: ENOENT: no such file or directory, open 'vite.config.ts'     (prepareSvelteKitSandbox)

(e.g. on #35125: builds 1591247, 1591177)

The fix joins the sandbox cwd in getConfigFile, matching the existing readFile(join(sandboxDir, configFile)) pattern elsewhere in the file.

Manual testing

Ran yarn task sandbox --template svelte-kit/skeleton-ts --start-from auto with the fix: sandbox creation passes the previously failing prepare step, and the generated vite.config.ts contains the intended compilerOptions.experimental.async and experimental.remoteFunctions injections.

cc @Sidnioulz

Summary by CodeRabbit

  • Bug Fixes
    • Corrected configuration file resolution in sandbox tooling. Previously, configuration files could be resolved from the script's directory instead of the intended location, which has now been fixed to properly resolve paths relative to the specified working directory.

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.
@kasperpeulen kasperpeulen added build Internal-facing build tooling & test updates ci:normal Run our default set of CI jobs (choose this for most PRs). labels Jun 10, 2026
@kasperpeulen kasperpeulen enabled auto-merge June 10, 2026 15:08
@kasperpeulen kasperpeulen added the qa:skip Pull Requests that do not need any QA. label Jun 10, 2026
@kasperpeulen kasperpeulen disabled auto-merge June 10, 2026 15:25
@Sidnioulz Sidnioulz merged commit 8d02690 into next Jun 10, 2026
124 of 138 checks passed
@Sidnioulz Sidnioulz deleted the kasper/fix-svelte-sandbox-config-path branch June 10, 2026 15:54
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.
@Sidnioulz Sidnioulz added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jun 11, 2026
@github-actions github-actions Bot mentioned this pull request Jun 11, 2026
11 tasks
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:normal Run our default set of CI jobs (choose this for most PRs). patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch qa:skip Pull Requests that do not need any QA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants