Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Config and ConfigProvider Module #2687

Open
juanseveso opened this issue May 2, 2024 · 0 comments
Open

Issue with Config and ConfigProvider Module #2687

juanseveso opened this issue May 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@juanseveso
Copy link

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

@juanseveso juanseveso added the bug Something isn't working label May 2, 2024
@juanseveso juanseveso changed the title Issue with Config and ConfigProvider Module in Effect-ts Issue with Config and ConfigProvider Module May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant