Skip to content

Switching environments#120

Merged
skosijer merged 5 commits intodevfrom
stevank/eng-939
Sep 8, 2025
Merged

Switching environments#120
skosijer merged 5 commits intodevfrom
stevank/eng-939

Conversation

@skosijer
Copy link
Copy Markdown
Contributor

@skosijer skosijer commented Sep 5, 2025

📋 Pull Request Summary

  • Switching environments from the new conversation settings modal
  • The conversation gets updated with a new data source environment
  • The snapshot (app) gets the new environment variables reloaded from the switched environment
  • For testing I've used two databases with same schema and different data, created a single data source that has two environments (development and production) and then confirmed that the switching of environment updates the env vars in the built app, switches the conversation to a different environment data source and updates the data presented in the built app ✅
image image image image

@skosijer skosijer marked this pull request as ready for review September 8, 2025 11:22
@skosijer skosijer merged commit 0f3e535 into dev Sep 8, 2025
4 checks passed
@skosijer skosijer deleted the stevank/eng-939 branch September 8, 2025 13:14
} else {
// In production, this should fail - never generate a key
if (env.server.NODE_ENV === 'production') {
if (process.env.NODE_ENV === 'production') {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Managed to solve this bug through this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Explanation of the issue:
The whole data-access/ folder ends in the built app starters (next-starter, remix-starter).
This is how the code sharing is being possible between the liblab ai builder and the built app starters.
For that reason we cannot use any imports relative to the ai builder (e.g. "~/env") because the folder copying logic will try to define the built app package.json and it will assume from this line that there is a dependency for "~": "latest" which will eventually break the built app installation and preview because of a missing module error.

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