Skip to main content
Here’s an easy-to-follow guide to some common hurdles you may face while deploying your apps on Emergent.
The list is not exhaustive, and you may face issues that are not listed here. For the general format to follow when troubleshooting, do refer to the other articles in the Troubleshooting tab.

Overview

Deployment is how your app goes from a live preview URL that is only active for 30 minutes at a time to an always accessible, permanent live link that you can share with friends, colleagues, clients and the world at large. Deployment is essentially moving the code from one “workspace” to another. Here are some common issues you may face, and how to solve them:

Issue 1: Missing API Configurations

Imagine you built an app that needs to:
  • Send emails
  • Process payments with Stripe
  • Use AI from OpenAI
  • Connect to a database
Each of these services needs a “key” (like a password) to work. During development, these keys might be stored locally on your computer. But when deploying, you need to give those keys to the deployment system.
You’ll know this is the problem if your app deploys but you see errors such as features that stop working, error codes like “undefined” or “missing API key”
Here’s what you can ask the agent:
To avoid this situation, we advise you to ask the agent if the project is missing any external configurations before attempting to deploy your app. Here’s a quick prompt you can use:

Issue 2: Database Connection Errors

Following the same example from the last issue, you may notice that the data you filled in during the preview stage does not carry over in the deployed app. The reason can be traced back to one key fact: The preview environment and the deployed environment on Emergent are two separate “spaces” - different environment, different databases. When you deploy an app, the settings from one space is summarised and moved to the final deployed space.
You’ll know the issue is database related if you see:
  • App starts but database related features are not loading (incomplete data points, features that save or load data don’t work)
  • Errors mentioning “MongoDB” or “Invalid Database Connection”
  • User logins, posting, or loading of items fail
  • Error messages about “connection timeouts” or “authentication failed”
In this situation, it is vital that we avoid prompting the agent with vague prompts that do not explain the gaps in functionality clearly. Here’s the kind of prompts that will actually help: Scenario 1: Database won’t connect
Scenario 2: Features worked locally but not after deployment
To avoid this situation, we advise you to ask the agent if the project has any database connection errors before attempting to deploy your app. Here’s a quick prompt you can use:

Issue 3: Missing Libraries or Dependancy Issues

Your app is built using various libraries or packages. Each of these libraries are called a “dependancy”. Sometimes when deploying:
  • The wrong versions of such libraries are used
  • The library that is used in the preview environment is different from the library used in the deployed environment
  • A library is not installed or incorrectly installed
This is an avoidable error by either asking the agent to verify that such issues do not exist, or by running a Pre-Deployment Health Check.
Here’s how you know your error falls into this category:
  • Deployment failed during the ‘Building’ phase.
  • Errors saying ‘Module Not Found’
  • Errors mentioning specific library names
Here are some examples to better illustrate the kind of prompts that help with these issues: Scenario 1: Deployment fails with “module not found”
Scenario 2: App crashes after building
Scenario 3: Added new features with new libraries
Scenario 4: General dependency check
As always, here is a simple prompt you should share with the agent before deploying the app, to prevent such errors from occuring: