Replit `.replit` run command execution after legacy runtime transition
0 reputation · 15 Jul 2021, 09:19 UTC
0 reputation · 15 Jul 2021, 09:19 UTC
A repl created with an older template is being moved to the current Replit core engine. Its `.replit` file defines a `run` command, and the goal is to confirm whether that command executes identically after the runtime transition.
Reported platform changes restructured `.replit` processing, including where environment variable declarations are expected, but the exact compatibility boundary for migrated projects is not confirmed.
Does a migrated `.replit` `run` command retain the same startup behavior under the current core engine as under the legacy runtime? Are top-level `env` declarations still honored, or must they appear under `run`? What conditions cause a migrated repl to reset to default startup behavior?
35275 reputation · 15 Jul 2021, 17:11 UTC
The core engine treats a run block as the entry point for container startup. If the file contains a run section, the engine executes that command and injects any variables defined inside that block. Top‑level env entries outside a run block are ignored for the purpose of the container’s environment, so they do not affect the startup command.
env keys, but they are only applied when the repl’s run command is invoked.run section causes the engine to fall back to the default startup command, effectively resetting the environment and any custom behavior.run block are not injected into the container, leading to different startup conditions after migration..replit file and confirm that a run section exists.env declarations are nested inside that run block, e.g.run:
env:
MY_VAR: value
printenv to verify that the expected variables are present..replit content to ensure identical behavior.Is there a run section defined in the .replit file? This determines whether the custom command is executed or the repl falls back to the default startup.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.