Skip to content

Conversation

@monadoid
Copy link
Contributor

@monadoid monadoid commented Jan 9, 2026

why

When trying to run the server binary, was seeing Error: ENOENT: no such file or directory, open 'C:\Users\Administrator\Desktop\python\stagehand-python-stainless\bin\sea\static\logo.svg'

what changed

Only registering swagger docs when NODE_ENV is developement

test plan

Will confirm that this resolves the error


Summary by cubic

Disable Swagger UI in production by registering it only when NODE_ENV is "development". This prevents SEA binary runtime errors caused by missing static assets (e.g., logo.svg).

Written for commit 46282a2. Summary will update on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

⚠️ No Changeset found

Latest commit: 46282a2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 9, 2026

Greptile Overview

Greptile Summary

Wraps the Swagger UI registration in a conditional check to only enable it when NODE_ENV is "development". This prevents Single Executable Application (SEA) binaries from failing when attempting to load Swagger UI's static assets (like logo.svg), which cannot be bundled into the executable.

Confidence Score: 4/5

  • Safe to merge after fixing the typo in the comment
  • The change correctly addresses the SEA binary issue by conditionally registering Swagger UI only in development. The logic follows the same pattern used elsewhere in the file for environment-specific configuration. The only issue is a minor typo in the comment ("developement" instead of "development").
  • No files require special attention beyond the typo fix

Important Files Changed

File Analysis

Filename Score Overview
packages/server/src/server.ts 4/5 Conditionally registers Swagger UI only in development to prevent SEA binary static file errors

Sequence Diagram

sequenceDiagram
    participant Server
    participant Fastify
    participant SwaggerUI
    
    Server->>Fastify: Register Swagger API
    Note over Fastify: Always registered
    
    alt NODE_ENV === "development"
        Server->>SwaggerUI: Register Swagger UI
        SwaggerUI-->>Server: Load static assets
    else NODE_ENV === "production"
        Note over Server,SwaggerUI: Skip Swagger UI registration
        Note over Server: Prevents SEA binary file errors
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

await app.register(fastifySwaggerUI, {
routePrefix: "/documentation",
});
// Only register Swagger UI in development - SEA binaries can't load static files
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in comment: "developement" should be "development"

Suggested change
// Only register Swagger UI in development - SEA binaries can't load static files
// Only register Swagger UI in development - SEA binaries can't load static files
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/server/src/server.ts
Line: 147:147

Comment:
Typo in comment: "developement" should be "development"

```suggestion
    // Only register Swagger UI in development - SEA binaries can't load static files
```

How can I resolve this? If you propose a fix, please make it concise.

@monadoid monadoid merged commit 191663d into main Jan 9, 2026
19 checks passed
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.

3 participants