{"id":17652394,"url":"https://github.com/bashleigh/typeorm-env-issue","last_synced_at":"2025-03-30T09:12:57.576Z","repository":{"id":103668588,"uuid":"159949109","full_name":"bashleigh/typeorm-env-issue","owner":"bashleigh","description":"Repo to replicate env issue as asked","archived":false,"fork":false,"pushed_at":"2018-12-01T14:02:17.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T11:17:13.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bashleigh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-01T13:48:26.000Z","updated_at":"2018-12-01T14:02:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"1819b16a-b65c-4691-8f93-01657afd3a38","html_url":"https://github.com/bashleigh/typeorm-env-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2Ftypeorm-env-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2Ftypeorm-env-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2Ftypeorm-env-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2Ftypeorm-env-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bashleigh","download_url":"https://codeload.github.com/bashleigh/typeorm-env-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296615,"owners_count":20754635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T11:46:45.516Z","updated_at":"2025-03-30T09:12:57.554Z","avatar_url":"https://github.com/bashleigh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typeorm-env-test\n\nThis issue persists in v0.2.9.\n\nI added a console log of `options` in Connection's constructor https://github.com/typeorm/typeorm/blob/0.2.6/src/connection/Connection.ts#L118 for the example below \n\n![](example-printout.png)\n\nI've used docker to be consistent with the environment that I found the issue in. I've also used nestjs to replicate the environment but that's completely separate to the issue.\n\nI've added a migration file so running `node_modules/.bin/ts-node node_modules/.bin/typeorm migration:run` should run the file, however it's not found due to the issue. \n\n## Setup \n\nRun `yarn setup` to create your `.env` file and start the docker container. \n\n```bash\n$ yarn setup\n```\n\nUse `yarn ash` to get into the container\n\n```bash\n$ yarn ash\n```\n\nor use the exec command on docker-compose (used in the above).\n\n```bash \n$ docker-compose exec node ash\n```\n\n## Running \n\nIn my dev environment at the time I was running everything from the ts files rather than the javascript files. I did run my js files but only when I was ready to deploy and test the deployment would work on kubernetes (yes save me...). So at the time I was running everything through ts-node. This issue persists without using ts-node. \n\nTo see the output of the options, I added a console.log within the constructor of Connection which gave me the `migrations: ['src/migrations/*.{ts', 'js}']` result.\n\n```ash\n$ node_modules/.bin/ts-node node_modules/.bin/typeorm migration:run\n```\n\nThe issue also persists with \n\n```ash\n$ node_modules/.bin/typeorm migration:run\n```\n\n### Further weirdness\n\nI also added speach marks around the `TYPEORM_MIGRATIONS` env in the env file but this resulted in the same result.\n\n```\nTYPEORM_MIGRATIONS=\"src/migrations/*.{ts,js}\"\n```\nThe result is `migrations: ['\"src/migrations/*.{ts', 'js}\"']`. (Don't forget trying this requires the container to be re-instanced with the new envs `docker-compose up -d --build --force-recreate node`)\n\n\n\u003e Let me know if there's anything else I can do! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashleigh%2Ftypeorm-env-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashleigh%2Ftypeorm-env-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashleigh%2Ftypeorm-env-issue/lists"}