Skip to content

[bug] bun dev command is stuck in an infinite restart loop! #2099

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

Closed
Rish-it opened this issue Jun 7, 2025 · 3 comments
Closed

[bug] bun dev command is stuck in an infinite restart loop! #2099

Rish-it opened this issue Jun 7, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Rish-it
Copy link
Contributor

Rish-it commented Jun 7, 2025

Describe the bug

@onlook/web-client dev:   5 |
│ @onlook/web-client dev: > 6 | const sdk = new FreestyleSandboxes({
│ @onlook/web-client dev:     |            ^
│ @onlook/web-client dev:   7 |     apiKey: env.FREESTYLE_API_KEY
│ @onlook/web-client dev:   8 | });
│ @onlook/web-client dev:   9 | {

I noticed that the FREESTYLE_API_KEY environment variable is marked as optional in the schema (z.string().optional()), but it's still being used to instantiate FreestyleSandboxes in the domain router.

The issue is that if the env variable is missing or undefined, it ends up trying to create the SDK with undefined as the API key. That probably causes the constructor to throw, which then crashes the dev server and since it's in the startup path, it just keeps restarting in an infinite loop.

We’ll either need to make the env var required or add a proper check before initializing the SDK.

@Rish-it Rish-it added the bug Something isn't working label Jun 7, 2025
@subhojit-crypto
Copy link

Any idea to this ? #2098

@Rish-it
Copy link
Contributor Author

Rish-it commented Jun 7, 2025

@subhojit-crypto are you setting up desktop app?

@Kitenite
Copy link
Contributor

Kitenite commented Jun 7, 2025

Hello,
Sorry this is a new env variable that needed to be handled better. Fixed now
#2097

@Kitenite Kitenite closed this as completed Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants