IE 11 - fetch undefined
See original GitHub issueI had to include the source code in my project and modified OidcConfigService to fix this problem. I also had to import { Buffer } from ‘buffer’; into TokenHelperService as well as add (window as any).global = window; to polyfills.ts . Now I am getting a separate, likely un-related to this library, error. Same as this person.. How fun it is to work with IE. My project is based off of this one
import { HttpClient } from '@angular/common/http';
import { EventEmitter, Injectable, Output } from '@angular/core';
@Injectable()
export class OidcConfigService {
constructor(private http: HttpClient) { }
@Output()
onConfigurationLoaded = new EventEmitter<boolean>();
clientConfiguration: any;
wellKnownEndpoints: any;
load(configUrl: string) {
try {
this.http.get(configUrl).subscribe((clientConfig: any) => {
this.clientConfiguration = clientConfig;
this.http.get(`${clientConfig.stsServer}/.well-known/openid-configuration`).subscribe((data) => {
this.wellKnownEndpoints = data;
this.onConfigurationLoaded.emit(true);
});
});
} catch (err) {
console.error(
`OidcConfigService 'load' threw an error on calling ${configUrl}`,
err
);
this.onConfigurationLoaded.emit(false);
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Getting fetch is undefined in internet explorer 11?
I am coming to an issue where my code below, says that 'fetch' is undefined in internet explorer 11. I am using the...
Read more >JavaScript runtime error: 'fetch' is undefined in IE11 #7370
Hi, i get this error in IE11: 'fetch' is undefined. On this line: var f$1 = fetch; [pouchdb-7.0.0.js] Line 4838
Read more >How to polyfill JavaScript fetch function for Internet Explorer
For fetch to work on Internet Explorer, we need to add two polyfills: Promise polyfill - remember, fetch uses promises; Fetch polyfill. // ......
Read more >[AG-Grid] JavaScript error in IE11: 'fetch' is undefined
It seems this component is using Fetch API to retrieve data from the server (in one of the possible implementations to render data...
Read more >On IE11 getting error SCRIPT5009: 'fetch' is undefined
I'm getting an error when trying to open my app in IE v11.0.90. When I check the console window it shows the following...
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
No results found
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
You’ll need a fetch polyfill likely. Per the documentation:
IE 11, Edge fetch For the fetch to work, or the app init, you need to include the isomorphic-fetch package. https://www.npmjs.com/package/isomorphic-fetch And add this to the polyfills /** Workaround for IE11 and polyfill problem */ import ‘isomorphic-fetch’;
Should be fixed with https://github.com/damienbod/angular-auth-oidc-client/commit/a24bc53a5993d82e3adc4d8937d45448d92424ba