Attempting to use Datadog RUM with Nuxt in plugin, but fetch is already aliased before RUM can overwrite it.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 195
- PR merge metrics
- No merged PRs in 30d
Description
Environment
"@datadog/browser-rum": "^5.0.0",
"nuxt": "^3.7.4",
Reproduction
Not sure if I can set up an example as this might be a paid product only.
Describe the bug
I have the integration set up as a Nuxt plugin, and datadog attempts to override window.fetch, but at that point, fetch has already been stored as the original function in ofetch, so none of the callbacks get intercepted with appropriate headers. I don't see a manual way to override fetch after the fact. Is there a way to override this fetch in Nuxt?
Additional context
No response
Logs
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading ofetch's fetch initialization and the linked Datadog fetch instrumentation to understand when window.fetch is captured and overwritten. The issue is done when the Nuxt/plugin integration has a documented or supported way to ensure Datadog RUM intercepts requests with its headers, backed by a demonstrated reproduction or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- api, tooling, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100