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

Error: Cannot assign to read only property 'headers' of object '[object Request]' #1273

Closed
kkruk-sumo opened this issue Jul 2, 2020 · 1 comment · Fixed by #1274
Closed
Assignees
Labels
bug Something isn't working

Comments

@kkruk-sumo
Copy link
Contributor

What version of OpenTelemetry are you using?

0.9.0

What version of Node are you using?

12.7.0

What did you do?

fetch(new Request('/api'))

What did you expect to see?

Fetch request to be sent and auto-instrumented by opentelemetry-plugin-fetch.

What did you see instead?

An error:

Error: Cannot assign to read only property 'headers' of object '[object Request]

Additional context

opentelemetry-plugn-fetch is trying to change the headers attribute on a given fetch constructor parameter (see

options.headers = Object.assign({}, headers, options.headers || {});
).
It fails, because the fetch constructor accepts an object or an instance of Request and the headers of a Request has no setter.

@kkruk-sumo kkruk-sumo added the bug Something isn't working label Jul 2, 2020
@dyladan dyladan self-assigned this Jul 2, 2020
@dyladan
Copy link
Member

dyladan commented Jul 2, 2020

PTAL at #1274 as a fix

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

Successfully merging a pull request may close this issue.

2 participants