Unleash / unleash-client-nextjs

Unleash SDK for Next.js
27 stars 8 forks source link

getFrontendFlags hangs indefinitely when unleash-proxy is not reachable #35

Closed karl-run closed 1 year ago

karl-run commented 1 year ago

Describe the bug

https://github.com/Unleash/unleash-client-nextjs/blob/main/lib/src/getFrontendFlags.ts#L20-L23

The promise isn't rejected on error, so when "ready" is never triggered, the code hangs forever.

Steps to reproduce the bug

  1. Call getFrontendFlags without a running unleash-proxy available
  2. Observe that Unleash: unable to fetch feature toggles is logged, but promise remains unresolved.

Expected behavior

The promise should reject when it fails.

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

karl-run commented 1 year ago

I tried patching node_modules with this change in my app: #36. Seems to work as expected.