Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

DI Error in IE following shim installation #926

Closed
im1dermike opened this issue May 10, 2017 · 4 comments
Closed

DI Error in IE following shim installation #926

im1dermike opened this issue May 10, 2017 · 4 comments

Comments

@im1dermike
Copy link

I had created issue #891 where I was getting a 'WeakMap' is undefined error when I tried to load the ASP.NET Core Angular 2 app in IE10. @SteveSandersonMS suggested I import core-js which resolved the WeakMap issue, but now I'm getting this error:

SCRIPT5022: Error: DI Error
vendor.js, line 104835 character 13

The app works fine in all other browsers.

@MarkPieszak
Copy link
Contributor

MarkPieszak commented May 10, 2017

I'm not sure which shim you've used, but you need to have the correct shims to for IE support lower than IE11.
See here for a reference of what you'd need: https://github.com/MarkPieszak/aspnetcore-angular2-universal/blob/master/Client/polyfills/polyfills.ts#L6-L24

@im1dermike
Copy link
Author

@MarkPieszak I ran the following:

npm install --save classlist.js
npm install --save web-animations-js

Then changed the top of my boot-client.ts file to look like this:

import 'core-js/shim';
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'classlist.js';  // Run `npm install --save classlist.js`.
import 'web-animations-js';  // Run `npm install --save web-animations-js`.

import 'angular2-universal-polyfills/browser';
import { enableProdMode } from '@angular/core';
import { platformUniversalDynamic } from 'angular2-universal';
import { AppModule } from './app/app.module';
import 'bootstrap';
const rootElemTagName = 'app'; // Update this if you change your root component selector

The same issue remains.

@im1dermike
Copy link
Author

Any update on this? It's not really OK that this library doesn't work in IE10.

@SteveSandersonMS
Copy link
Member

We have an existing issue tracking support for older IE versions at #484. I'll close this as a duplicate of that.

It's not really OK that this library doesn't work in IE10.

The template isn't meant to support all legacy browsers by default, as that would bloat the resulting application and not everyone needs that support. However I recognise that we could use clear docs on what polyfills are needed for people who do want to support legacy browsers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants