Effect-TS / effect

An ecosystem of tools to build robust applications in TypeScript

Home Page:https://effect.website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with Config and ConfigProvider Module

juanseveso opened this issue · comments

What version of Effect is running?

3.1.1

What steps can reproduce the bug?

import { Config, ConfigProvider, Effect, pipe } from "effect"

pipe(
  Config.array(Config.string(), "array"),
  Effect.andThen((conf) => Effect.log(conf)),
  Effect.withConfigProvider(
    pipe(
      ConfigProvider.fromMap(new Map([["parent.array", "a,b,c"]])),
      ConfigProvider.nested("parent")
    )
  ),
  Effect.runSync
)
import { Config, ConfigProvider, Effect, pipe } from "effect"

pipe(
  Config.array(Config.string("array")),
  Effect.andThen((conf) => Effect.log(conf)),
  Effect.withConfigProvider(
    pipe(
      ConfigProvider.fromMap(new Map([["parent.array", "a,b,c"]])),
      ConfigProvider.nested("parent")
    )
  ),
  Effect.runSync
)

What is the expected behavior?

I expect the configuration to be nested only once, resulting in parent.array.

What do you see instead?

The configuration is being doubly nested, resulting in (Missing data at parent.parent.array: "Expected parent.parent.array to exist in the provided map")

Additional information

No response