Skip to content

Commit f80b2e6

Browse files
yurynixclaude
andcommitted
fix(dev): write VITE_BASE44_APP_BASE_URL instead of VITE_BASE44_BACKEND_URL in .env.local
VITE_BASE44_BACKEND_URL is only consumed by the vite plugin's legacy compat shim (when legacySDKImports: true). The variable that actually enables the Vite dev-server proxy (/api → local dev server) is VITE_BASE44_APP_BASE_URL, as read by the plugin's non-sandbox config branch. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 895fe98 commit f80b2e6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/cli/src/cli/commands/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function writeEnvLocalIfMissing(
3737
const { id: appId } = await initAppConfig();
3838
await writeFile(
3939
envLocalPath,
40-
`VITE_BASE44_APP_ID=${appId}\nVITE_BASE44_BACKEND_URL=${localServerUrl(port)}\n`,
40+
`VITE_BASE44_APP_ID=${appId}\nVITE_BASE44_APP_BASE_URL=${localServerUrl(port)}\n`,
4141
);
4242
log.info("Created .env.local with app ID and dev server URL");
4343
}

packages/cli/tests/cli/dev.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ describe("dev command", () => {
4747

4848
const content = await t.readProjectFile(".env.local");
4949
expect(content).toContain(`VITE_BASE44_APP_ID=${t.api.appId}`);
50-
expect(content).toContain("VITE_BASE44_BACKEND_URL=http://localhost:");
50+
expect(content).toContain("VITE_BASE44_APP_BASE_URL=http://localhost:");
5151
});
5252

5353
it("does not overwrite .env.local when it already exists", async () => {
5454
await t.givenLoggedInWithProject(fixture("full-project"));
5555

5656
const existing =
57-
"VITE_BASE44_APP_ID=existing-id\nVITE_BASE44_BACKEND_URL=http://localhost:9999\n";
57+
"VITE_BASE44_APP_ID=existing-id\nVITE_BASE44_APP_BASE_URL=http://localhost:9999\n";
5858
await writeFile(join(t.getTempDir(), "project", ".env.local"), existing);
5959

6060
const handle = await t.runLive("dev");

0 commit comments

Comments
 (0)