Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix No path found at for StaticSite Construct #3485

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/great-crabs-crash.md
@@ -0,0 +1,5 @@
---
"sst": patch
---

Service: expose application load balancer
18 changes: 9 additions & 9 deletions packages/sst/src/constructs/StaticSite.ts
Expand Up @@ -525,15 +525,6 @@ interface ImportMeta {
private buildApp() {
const { path: sitePath, buildCommand } = this.props;

// validate site path exists
if (!fs.existsSync(sitePath)) {
throw new Error(
`No path found at "${path.resolve(sitePath)}" for the "${
this.node.id
}" StaticSite.`
);
}

Comment on lines -528 to -536
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @suil this is checking the path to the site, not the output generated by the build command.

// build
if (buildCommand) {
try {
Expand All @@ -552,6 +543,15 @@ interface ImportMeta {
);
}
}

// validate site path exists
if (!fs.existsSync(sitePath)) {
throw new Error(
`No path found at "${path.resolve(sitePath)}" for the "${
this.node.id
}" StaticSite.`
);
}
}

private createS3Assets(): Asset[] {
Expand Down