-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Polyfills for IE11 not working, for example .includes() #4128
Comments
See here: https://github.com/zloirock/core-js#ecmascript-7-proposals |
Ok, I though the function includes belongs the es6 string. But obviously I am working with an array ... and the array includes is es7. I added "import 'core-js/es7/array';" to polyfills.ts --> works perfect! Thanks a lot! |
Go to your polyfills.ts and find the import statements commented out under the section: Uncomment these to have your app working with these IE browsers. |
Thanks @tolgabalci I uncommented the IE related imports line from polyfills.ts file. I think one more point is we have to install couple of npm packages mentioned on polyfill.ts file. I overlooked them and it was not working. Then I had to go install classlist.js and web-animations-js etc.. npm packages. |
I dont see polyfill.ts getting created along with the app. |
@phani257 polyfills.ts is created under the src folder. |
I got the same issue. Thanks for the solution. |
Is it possible to choose these polyfills when running the cli instead of needing to come back to remove the comments? Let's say I know that all of the sites that I generate will need to be run in I.E. ..... |
I have polyfills.js but can't find polyfills.ts... |
why are these not uncommented, to begin with? |
If anyone else tries @suuuunto's es7 fix and gets
|
I still get this error - not sure why this is closed: SCRIPT5022: SecurityError `/**
/***************************************************************************************************
/** IE9, IE10 and IE11 requires all of the following polyfills. **/ /** Issue with IE and FormData **/ /** IE10 and IE11 requires the following for NgClass support on SVG elements */ /** IE10 and IE11 requires the following for the Reflect API. */ /** Evergreen browsers require these. **/ /** need for 'includes' etc... **/ /**
/**
// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame /*
/*
//https://github.com/angular/zone.js/issues/933 Added only for IE and Edge /***************************************************************************************************
/***************************************************************************************************
` |
Don't forget to add this as well. |
This is still broken, core-js has changed and object.freeze throws errors. ie. |
@etonyali: you don't need to add this meta tag (X-UA-Compatible) anymore (for most cases): https://stackoverflow.com/questions/26346917/why-use-x-ua-compatible-ie-edge-anymore Exception: "you're hosting a site in the Local Intranet zone" or for local development (as @etonyali pointed out) |
@hpawe01 if you are developing locally, you should add it. Please review the link you posted. |
@etonyali: fair enough. It sounded like an edge case and I didn't thought, that you also need it for local development. Updated my comment. |
this is working for me just doing so : no need for es6/ + es7/ |
you can further break down to just doing: |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Windows 8, 10. Linux (Ubuntu15.10). Mac OSX ( El Capitan)
Versions.
angular-cli: 1.0.0-beta.24
node: 5.12.0
os: linux x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4
@angular/compiler-cli: 2.4.4
Repro steps.
App was created with angular-cli beta 24, github example on https://github.com/suuuunto/includes-example
Component has an function includes() and the result goes to console.
For ng build, tsconfig.json had to be adjusted to "es7" for "lib", with "es6" a build error occurs
Open page with IE 11 on Win 8.1 an error occurs in console:
EXCEPTION: Object doesn't support property or method 'includes'
Imo core-js polyfills should solve that.
The log given by the failure.
EXCEPTION: Object doesn't support property or method 'includes'
Thanks, suuuunto
The text was updated successfully, but these errors were encountered: