Skip to content

fix(icp-dapp-launcher): use production II URL and fix JS asset paths on IC#271

Merged
Web3NL merged 4 commits into
mainfrom
fix/launcher-prod-deploy
Mar 24, 2026
Merged

fix(icp-dapp-launcher): use production II URL and fix JS asset paths on IC#271
Web3NL merged 4 commits into
mainfrom
fix/launcher-prod-deploy

Conversation

@Web3NL

@Web3NL Web3NL commented Mar 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wrong II URL in prod: deploy-launcher.sh called icp deploy without first running npm run build. The icp tool only uploads the existing build/ directory — it never invokes Vite. So ICP_NETWORK=ic had no effect, PROD was always false, and the local dev II URL (rdmx6-jaaaa...) was embedded instead of https://id.ai. Fixed by explicitly building with ICP_NETWORK=ic before deploying.

  • JS assets returning text/html MIME error: trailingSlash='ignore' caused SvelteKit to output launch.html with relative asset paths like ./_app/.... The ICP HTTP gateway redirects /launch/launch/ because files exist under /launch/. At /launch/, those paths resolve to /launch/_app/... which doesn't exist, so the asset canister returns its HTML fallback — causing text/html MIME type on JS module scripts. Fixed by switching to trailingSlash='always', which generates launch/index.html with ../_app/... paths that resolve correctly from /launch/.

Test plan

  • Run ./scripts/deploy-launcher.sh patch and verify the deployed app uses https://id.ai for II login
  • Verify no JS MIME type errors in the browser console at https://mycanister.app/launch

🤖 Generated with Claude Code

Web3NL and others added 4 commits March 24, 2026 23:43
…on IC

Two bugs prevented correct production deployment:

1. deploy-launcher.sh ran `icp deploy` without first running `npm run build`.
   The `icp` tool only uploads the existing build/ directory — it never invokes
   Vite. So ICP_NETWORK=ic had no effect and PROD was always false, embedding
   the local dev II URL (rdmx6-jaaaa...) instead of https://id.ai.
   Fix: explicitly build with ICP_NETWORK=ic before deploying.

2. trailingSlash='ignore' caused SvelteKit to output launch.html with relative
   asset paths like ./_app/... The ICP HTTP gateway redirects /launch → /launch/
   (trailing slash) because files exist under /launch/. At /launch/, the paths
   resolve to /launch/_app/... which doesn't exist, so the asset canister
   returns its HTML fallback — causing the 'text/html' MIME type error on JS
   module scripts.
   Fix: trailingSlash='always' generates launch/index.html with ../_app/...
   paths that resolve correctly from /launch/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Local PocketIC server binary is v13.0.0 but the workspace crate was
pinned to 12.0.0 (which rejects >=13). Bumping to 13.0.0 resolves the
version mismatch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wasm-registry and demos now default to mainnet IDs so local dev and
production both work without VITE_* env vars set. The VITE_* override
is kept for CI, where local canisters are deployed with different IDs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Web3NL Web3NL merged commit 64a87a4 into main Mar 24, 2026
1 check failed
@Web3NL Web3NL deleted the fix/launcher-prod-deploy branch March 28, 2026 14:53
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