Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

XMLHttpRequest cannot be used when running ipfs in a service worker #1477

Closed
vasco-santos opened this issue Jul 29, 2018 · 0 comments · Fixed by #1478
Closed

XMLHttpRequest cannot be used when running ipfs in a service worker #1477

vasco-santos opened this issue Jul 29, 2018 · 0 comments · Fixed by #1478
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP

Comments

@vasco-santos
Copy link
Member

self.XMLHttpRequest is not a constructor

  • Version: 0.31.0
  • Platform: Browser
  • Subsystem: Preload

Type: Bug

Severity: Critical

Description:

Service workers does not support XMLHttpRequest. This way, a service worker cannot run this version of js-ipfs. Can the XMLHttpRequest be changed to use fetch instead?

const req = new self.XMLHttpRequest()

Steps to reproduce the error:

Instantiate an IPFS node inside a service worker

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/wizard Extensive knowledge (implications, ramifications) required status/ready Ready to be worked P0 Critical: Tackled by core team ASAP labels Jul 29, 2018
@ghost ghost assigned alanshaw Jul 29, 2018
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels Jul 29, 2018
@alanshaw alanshaw added exp/novice Someone with a little familiarity can pick up and removed exp/wizard Extensive knowledge (implications, ramifications) required labels Jul 29, 2018
@ghost ghost removed the status/in-progress In progress label Jul 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants