Skip to content

HttpClient POST using request() method error on Firefox: event is not defined #22730

@SpeedoPasanen

Description

@SpeedoPasanen

I'm submitting a...


[ x ] Bug report 

Current behavior

In Firefox, trying to upload FormData using HttpClient.request() instead of .post() causes event is not defined. I just moved to using .request() because I want to track the upload progress, and everything was working previously.

The error occurs before request is sent, ie. nothing in the network tab.

Expected behavior

Should work as it does in Chrome, Edge and IE11.

Minimal reproduction of the problem with instructions

Open this StackBlitz in Firefox, select a file with the input, see error in console.

On Chrome, you should see 403 as expected. On FF, you should see event is undefined and a stack trace pointing to a weird line number in common/esm5/http.js.

Hacked a bit into http.js and added logging to both places where I could find the name event, which is in onUpProgress() and onDownProgress() and neither one of these gets ever called on FF, so I can't figure out where this event even is.

Environment


Angular version: 5.2.8

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ x ] Firefox version 58.0.2
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
- Platform:  Windows

Other

StackOverflow question

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions