sst icon indicating copy to clipboard operation
sst copied to clipboard

StaticSite and SsrSite: Fixes issues #3344

Open morficus opened this issue 2 years ago • 1 comments

See issue #3344 for details

After doing quite a bit of digging, I was able to determine that the root cause is because child_process.exec() (and, by extension, execSync()) does not support spaces in the command path. You can read all about it on this NodeJS issue from 2016: https://github.com/nodejs/node/issues/6803

Based on the comments from the NodeJS issue, the proper solution is to escape (not encode) the path with spaces. On MacOS, this can be done by doing \\ , which is not cross-system compatible, but wrapping the path in " " is indeed supported on all operating systems.

So this PR is doing just that: wrapping the script and zipPath values in double quotes.

I checked for other instances of execSync in the code, but all the others appeared safe. These seem to be the only ones that failed because they reference an external script (support/base-site-archiver.mjs) using an absolute path.

morficus avatar Sep 23 '23 04:09 morficus

🦋 Changeset detected

Latest commit: c9cee9e2b114a29daf8e4c695e30e59c65f394b4

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

This PR includes changesets to release 6 packages
Name Type
sst Minor
@sst/console Minor
create-sst Minor
astro-sst Minor
svelte-kit-sst Minor
solid-start-sst Minor

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

changeset-bot[bot] avatar Sep 23 '23 04:09 changeset-bot[bot]