-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Describe the bug
When @unleash/proxy-client-react is unable to fetch feature toggles, it throws an error but does not log sufficient information about the failure. This makes it difficult to diagnose and troubleshoot the issue.
Steps to reproduce the bug
- Set up
@unleash/proxy-client-reactin your project. - Simulate a scenario where the proxy server is unreachable or returns an error. ie. block app.unleash-hosted.com/silver/api/frontend/client/metrics from the browser side
- Observe the lack of detailed logging information in the browser console.
Expected behavior
The library should log detailed information about the failure to fetch feature toggles, including the error message and any relevant context, to aid in diagnosing and troubleshooting the issue.
Logs, error output, etc.
-
Unleash: unable to fetch feature toggles TypeError: Failed to fetch (reproducible in example project)
-
Error: console.error: Unleash: unable to fetch feature toggles TypeError: Failed to fetch at ? (https://cdn....
-
Error: console.error: Unleash: unable to fetch feature toggles TypeError: Load failed at ? (https://cdn...
-
Error: console.error: Unleash: unable to send feature metrics TypeError: Load failed at ? (https://cdn...
-
Error: console.error: Unleash: unable to send feature metrics TypeError: Failed to fetch at ? (https://cdn..
-
Error: console.error: Unleash: unable to send feature metrics TypeError: NetworkError when attempting to fetch resource. at ? (https://cdn...
The full stacktrace:
Error: console.error: Unleash: unable to send feature metrics TypeError: Load failed at ? (<cdn-server-hostname>/node_modules/@grafana/faro-web-sdk/dist/esm/instrumentations/console/instrumentation.js:20:53) at ? (<cdn-server-hostname>/node_modules/unleash-proxy-client/build/main.esm.js:1:5671) at t (<cdn-server-hostname>/node_modules/unleash-proxy-client/build/main.esm.js:1:1758) at t (<cdn-server-hostname>/node_modules/unleash-proxy-client/build/main.esm.js:1:555) at ? (<cdn-server-hostname>/node_modules/zone.js/fesm2015/zone.js:111:49) at delegate (<cdn-server-hostname>/node_modules/zone.js/fesm2015/zone.js:2538:43) at ? (<cdn-server-hostname>/node_modules/zone.js/fesm2015/zone.js:159:57) at task (<cdn-server-hostname>/node_modules/zone.js/fesm2015/zone.js:581:42)
Screenshots
Additional context
Example project with @unleash/proxy-client-react implemented, where you are able to add your own example configs as search params:
https://unleash-feature-toggle-exception-example-v5qh.vercel.app/?appName=example-project-name>&unleashUrl=https://app.unleash-hosted.com/silver/api/frontend&unleashToken=default:development.unleash-insecure-api-token&featureFlag=example-feature-flag
See example repo here: https://github.com/maqnus/unleash-feature-toggle-exception-example
Unleash version
4.4.0
Subscription type
Pro
Hosting type
Hosted by Unleash
SDK information (language and version)
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
