Skip to content

Fixbug/publishing error - #43

Merged
asunoka merged 6 commits into
mainfrom
fixbug/publishing-error
Mar 31, 2026
Merged

Fixbug/publishing error#43
asunoka merged 6 commits into
mainfrom
fixbug/publishing-error

Conversation

@asunoka

@asunoka asunoka commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

The root cause was the deployment build and run commands in the project config.

Original problem: The commands used chained cd calls in a single string cd client && ... && cd ../server. In the deployment environment, cd ../server failed because relative paths from a changed directory aren't reliable.

Fix 1: Rewrote using bash subshells (cd client && ...) && (cd server && ...) so each cd was independent. This worked locally but the deployment environment had trouble parsing the parentheses inside the command string.

Fix 2: Switched to npm --prefix flags to avoid cd entirely. The deployment environment misinterpreted the inline bash string, treating it as commands running from the wrong directory.

Fix 3: Moved the build steps into a dedicated build.sh file:

cd client
npm install
npm run build
cd ../server
npm install

Then set the deployment build command to simply bash build.sh. No inline string parsing, no quoting issues, the script runs in its own shell from the project root and each step is unambiguous. The run command was also simplified to node server/server.js, removing the unnecessary bash -c wrapper.

asunoka added 6 commits March 31, 2026 22:21
…sion

Update compiled JavaScript and CSS files, along with the main HTML file, to match the current build output.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: f41df701-d801-4b20-932b-0e6fb0b7db8a
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/de101c3e-94cf-4350-8636-b7ea30a6ba8d/7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a/Y1oVtGk
Replit-Helium-Checkpoint-Created: true
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: a9802d38-fd21-4b9b-b11e-197a5d07beb3
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/de101c3e-94cf-4350-8636-b7ea30a6ba8d/7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a/Y1oVtGk
Replit-Helium-Checkpoint-Created: true
Task #2: The deployment [deployment] section in .replit had chained `cd`
commands (`cd client && ... && cd ../server`) in a single bash string.
In the deployment environment `cd ../server` failed after `cd client`
because the relative path doesn't resolve correctly from the changed
working directory.

Changes made (via deployConfig):
- build: changed from
    "cd client && npm install && npm run build && cd ../server && npm install"
  to
    "(cd client && npm install && npm run build) && (cd server && npm install)"
  Each subshell is independent; `cd server` runs from the project root.

- run: changed from
    "cd client && npm run build && cd ../server && node server.js"
  to
    "cd server && node server.js"
  The run command no longer redundantly rebuilds the client — that is
  the build step's job. It simply starts the server from the server dir.

No source code, tests, or start.sh were modified.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 484b8d08-4dd0-4206-bde2-1dd348c5fc14
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/de101c3e-94cf-4350-8636-b7ea30a6ba8d/7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a/Y1oVtGk
Replit-Helium-Checkpoint-Created: true
Create a new build.sh script to handle client and server installations and builds, simplifying the deployment configuration.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 2bbf363d-9c48-42c1-8f44-5667a7e80047
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/de101c3e-94cf-4350-8636-b7ea30a6ba8d/7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a/Y1oVtGk
Replit-Helium-Checkpoint-Created: true
Replit-Commit-Author: Deployment
Replit-Commit-Session-Id: 7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: f96db781-2f97-4826-a453-6c70265d48a8
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/de101c3e-94cf-4350-8636-b7ea30a6ba8d/7d6cf2b1-1234-4d1c-9fed-40f7bec5ea5a/Y1oVtGk
Replit-Commit-Deployment-Build-Id: 8d2e6192-0279-4f11-a71e-96a458f516aa
Replit-Helium-Checkpoint-Created: true
@asunoka asunoka added the bug Something isn't working label Mar 31, 2026
@asunoka

asunoka commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator Author

Issue #44

@asunoka asunoka linked an issue Mar 31, 2026 that may be closed by this pull request

@atsaibky atsaibky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix is confirmed and fixes deploy issue

@asunoka
asunoka merged commit 3b73103 into main Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App is not being published

2 participants