diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 1185a3e5c9..3be27789db 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Issue initializing .env file endpoints array (#2997) ## [6.6.2] - 2025-12-16 ### Fixed diff --git a/packages/cli/src/controller/init-controller.ts b/packages/cli/src/controller/init-controller.ts index 422c323687..601e77b530 100644 --- a/packages/cli/src/controller/init-controller.ts +++ b/packages/cli/src/controller/init-controller.ts @@ -319,7 +319,9 @@ export async function prepareEnv(projectPath: string, project: ProjectSpecBase): } //adding env configs - const envData = `ENDPOINT=${JSON.stringify(project.endpoint)}\nCHAIN_ID=${chainId}`; + const endpointStr = Array.isArray(project.endpoint) ? project.endpoint.join(',') : JSON.stringify(project.endpoint); + + const envData = `ENDPOINT=${endpointStr}\nCHAIN_ID=${chainId}`; await fs.promises.writeFile(envPath, envData, 'utf8'); await fs.promises.writeFile(envDevelopPath, envData, 'utf8'); await fs.promises.writeFile(envLocalPath, envData, 'utf8');