TypeMismatchedError on Edge
See original GitHub issueI am running my website with Edge on Window 10. Here is the code the produce the TypeMismatchedError, code: 17
return new Promise((resolve, reject) => {
return fetch('/api/search/trips', {
method: 'POST',
headers: {
"x-access-token": "example-key",
'Accept': 'application/json',
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify(searchData)
})
.then(response => response.json())
.then(json => resolve(json))
.catch(err => reject(err))
})
This code throws TypeMismatched exception before any request could be fired. I write it with Webpack.
It works fine in other Chrome, Firefox and Safari. Do you have any idea ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Compile error: Type mismatch Help - Microsoft Community
When I try to run it, I get the message "compile error: type mismatch," and when I use the debugger it highlights in...
Read more >error: Type Mismatch - education edge
When running the Requirement Audit Report for specific students, Users may receive the following: Error: Type Mismatch. This error can occur when the...
Read more >Resolving a "type mismatch" error : - Omatic Support
Hi all, Have just added a few static fields to a profile (which worked before) and now get an error for each record....
Read more >scala type mismatch error in graphX code - Stack Overflow
The first is a common problem with + in Scala, unfortunately. In this case you have not k -> (v + edge.attr) ,...
Read more >Type-Mismatch Error - ISACA
Sometimes, while writing code, programmers may ask that a value be stored in a variable that is not typed correctly, such as putting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the exact same problem. But I guess the answer is does not have to be on this repo but rather around here https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8546263/
Try running the fetch call from within Edge’s web console to isolate the code without other dependencies like Webpack.
This handler needs to detect if the request returned a successful response before consuming the JSON response body.
should be something like this
Fetch only invokes the
catch
handler in cases where aResponse
cannot be created, like network failures, for example. If the HTTP request and response cycle succeeded, thethen
handler is invoked, even if the HTTP status code is a failure.Edge has a native implementation of
window.fetch
and does not use this polyfill code, so I’ll close out this issue.