[bug] bun dev command is stuck in an infinite restart loop!
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.
Any idea to this ? https://github.com/onlook-dev/onlook/issues/2098
@subhojit-crypto are you setting up desktop app?
Hello, Sorry this is a new env variable that needed to be handled better. Fixed now https://github.com/onlook-dev/onlook/pull/2097