Skip to content

Fix preview server 500 error: use adapter-node output and preview environment#88

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-preview-server-500-error
Draft

Fix preview server 500 error: use adapter-node output and preview environment#88
Copilot wants to merge 5 commits intomainfrom
copilot/fix-preview-server-500-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

Preview server failed with 500 errors because vite preview doesn't execute adapter-node builds, and production builds fetch from http://www.jungesmusical.de which is inaccessible locally.

Changes

Environment configuration:

  • Added .env.preview with PUBLIC_HOMEPAGE_HOST=http://localhost:5001 for local preview builds

Build scripts:

  • preview: Changed from vite preview to node dist/index.js to execute the actual adapter-node server
  • build:preview: New script using vite build --mode preview
  • build: Remains vite build for production (uses .env.production)

Error handling:

  • Updated page loaders to properly propagate HTTP status codes instead of catching all errors as 500
  • Added type guards to distinguish SvelteKit errors from network/parsing errors

Usage

Preview with local homepage on port 5001:

npm run build:preview
npm run preview

Production build:

npm run build

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.jungesmusical.de
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 15, 2026 20:51
Co-authored-by: mayfinn <19761338+mayfinn@users.noreply.github.com>
… script

Co-authored-by: mayfinn <19761338+mayfinn@users.noreply.github.com>
Co-authored-by: mayfinn <19761338+mayfinn@users.noreply.github.com>
Co-authored-by: mayfinn <19761338+mayfinn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix 500 error when starting preview server Fix preview server 500 error: use adapter-node output and preview environment Feb 15, 2026
Copilot AI requested a review from mayfinn February 15, 2026 21:01
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.

2 participants