Skip to content

Conversation

@TooAngel
Copy link
Contributor

@TooAngel TooAngel commented Dec 4, 2025

Summary

  • Fixed production deployment failure caused by static vite import
  • Fixed Express wildcard route syntax for path-to-regexp v8+

Problems Fixed

1. Vite import in production

Cannot find package 'vite' imported from /app/server/index.js

The static import { createServer } from 'vite' runs at module load time, before the production check. Since vite is a devDependency, it gets pruned in production.

2. Wildcard route syntax

PathError [TypeError]: Missing parameter name at index 1: *

Express 5 / path-to-regexp v8 no longer accepts * or /* as wildcards.

Solution

  1. Use dynamic import for vite only in development
  2. Change wildcard routes from * / /* to {*path}

Test plan

  • Deploy to dokku and verify production server starts
  • Verify local development still works (npm start)

@worlddriven
Copy link

worlddriven bot commented Dec 4, 2025

🤖 Worlddriven Status

📊 Live Status Dashboard

🗓️ Merge Date: 2025-12-07 at 09:51:20 UTC (today)
📅 Started: 2025-12-04 at 21:51:20 UTC
Speed Factor: 0.25 (75% faster due to reviews)
Positive votes: 3/4 contribution weight (coefficient: 0.75)
📈 Base Merge Time: 10 days → Current: 3 days

🎯 Want to influence when this merges?

Your review matters! As a contributor to this project, your voice helps determine the merge timeline.

How to review:

  1. Check the changes
    Files changed

  2. Leave your review
    Review changes

Your options:

  • ✅ Agree & Speed Up: Approve Approving makes this merge faster
  • ❌ Disagree & Slow Down: Request changes Requesting changes delays the merge

💡 Pro tip: The more contributors who agree, the faster this gets merged!

📊 View detailed stats on the dashboard

📋 Recent Activity

2025-12-04, 21:41:40 - Pull request opened
2025-12-04, 21:51:27 - Branch synchronized (merge timer reset)
2025-12-07, 09:52:14 - Pull request merged by worlddriven ✅


This comment is automatically updated by worlddriven

Static import of vite fails in production because vite is a devDependency
that gets pruned. Changed to dynamic import inside the isProduction check
so the import only happens in development.
@TooAngel TooAngel force-pushed the fix/vite-production-import branch from 826f291 to c8c64d9 Compare December 4, 2025 21:51
@worlddriven worlddriven bot merged commit 7c618b1 into worlddriven:main Dec 7, 2025
2 checks passed
@TooAngel TooAngel deleted the fix/vite-production-import branch December 23, 2025 05:58
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