Skip to content

fix(ssr): give the Appwrite env vars placeholder defaults - #20

Merged
ChiragAgg5k merged 1 commit into
masterfrom
fix-ci
Nov 3, 2026
Merged

ChiragAgg5k merged 1 commit into
masterfrom
fix-ci

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Cause

Since the SvelteKit 3 migration in #18, server-side-rendering/src/env.ts declares PUBLIC_APPWRITE_ENDPOINT, PUBLIC_APPWRITE_PROJECT_ID and APPWRITE_KEY as static variables with no schema, so each must be set. Kit validates them during vite build, and the build fails with env_invalid on any checkout without a filled-in .env, including the verify job in #19. Marking them non-static does not help, because Kit validates runtime variables at build time too.

Fix

Give each variable a schema with a placeholder fallback: the Appwrite Cloud endpoint (https://cloud.appwrite.io/v1, also node-appwrite's default) and empty strings for the project ID and API key. This follows the example-auth demo, which hardcodes placeholder settings. No secret is committed.

Values from .env or the environment still take precedence, so following the README (copy .env.example to .env and fill it in) behaves as before. A committed .env.production was not used, because Vite ranks it above the user's .env.

Also adds the shared verify caller (identical to #19) so this PR runs the same check.

Verification

On Node 24, in server-side-rendering:

  • npm ci and npm run build succeed with no .env, inlining the placeholders.
  • With a .env, the build inlines its endpoint and project ID instead.
  • npm run check reports 0 errors and 0 warnings, and Prettier passes.

Unblocks #19 and addresses Hansi's finding there.

SvelteKit 3 validates declared env vars at build time, so building the demo without a filled-in .env failed with env_invalid. Placeholders (the Cloud endpoint, empty project ID and key) let it build; values in .env still take precedence.
@ghost

ghost commented Nov 3, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The fallback schemas preserve configured environment values and the new verification workflow is valid.

Adds fallback schemas for the SSR demo’s Appwrite endpoint, project ID, and API key so builds can run without a populated .env. Adds a shared GitHub Actions verification workflow for pull requests and pushes to master.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
server-side-rendering/src/env.ts Defines placeholder fallbacks for the three Appwrite environment variables.
.github/workflows/verify.yml Calls the pinned shared verification workflow for pull requests and pushes to master.

Reviewed 69c8105 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit 5152907 into master Nov 3, 2026
4 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix-ci branch November 3, 2026 21:24
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.

1 participant