1

I'm working on an angular 4 app, when i open it with chrome, firefox or ie edge browser it runs whithout a problem, but when i open it with ie 11 it shows me this error in the browser's console

SCRIPT1003: ':' attendu common.chunk.js (922,22)

ERROR Error: Uncaught (in promise): Error: Loading chunk common failed. Error: Loading chunk common failed. at Anonymous function (http://localhost:8091/vendor.bundle.js:219834:17) at CatchSubscriber.prototype.error (http://localhost:8091/vendor.bundle.js:136912:17) at Subscriber.prototype._error (http://localhost:8091/vendor.bundle.js:134986:9) at Subscriber.prototype.error (http://localhost:8091/vendor.bundle.js:134960:13) at OuterSubscriber.prototype.notifyError (http://localhost:8091/vendor.bundle.js:134456:9) at InnerSubscriber.prototype._error (http://localhost:8091/vendor.bundle.js:134005:9) at Subscriber.prototype.error (http://localhost:8091/vendor.bundle.js:134960:13) at Subscriber.prototype._error (http://localhost:8091/vendor.bundle.js:134986:9) at Subscriber.prototype.error (http://localhost:8091/vendor.bundle.js:134960:13) at Subscriber.prototype._error (http://localhost:8091/vendor.bundle.js:134986:9)

SCRIPT5022: SecurityError polyfills.bundle.js (5766,25)

polyfills.ts

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/es7/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';

app.routes.ts

import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';

export const routes: Routes = [
  { path: '', redirectTo: 'convention', pathMatch: 'full' },
  { path: 'network', loadChildren: './module/network/network.module#NetworkModule' },
  { path: 'convention', loadChildren: './module/convention/convention.module#ConventionModule' },
  { path: '**', redirectTo: 'convention' }
];

export const appRoutes: ModuleWithProviders = RouterModule.forRoot(routes, { useHash: true, preloadingStrategy: PreloadAllModules });

app.module.ts

@NgModule({
  imports: [
    CommonModule,
    CoreModule.forRoot(),
    NgbModalModule.forRoot(),
    appRoutes,
    StoreModule.forRoot(fromRoot.reducers),
    EffectsModule.forRoot([]),
    StoreDevtoolsModule.instrument({ maxAge: 50 })
  ],
  declarations: [
    ...APP_COMPONENT
  ],
  providers: [
    { provide: LocationStrategy, useClass: PathLocationStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

index.html

<!DOCTYPE html>
<html>

<head>
  <title></title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
  <base href="/">
</head>

<body>
  <app-root>
    <div class="loader loader-site">
      <div class="logo-beidys-loader"></div>
    </div>
  </app-root>
</body>

</html>
Aymen Kanzari
  • 1,765
  • 7
  • 41
  • 73
  • Did you try and look at this? https://stackoverflow.com/questions/45353619/angular4-application-running-issues-in-ie11 – Svend May 09 '18 at 11:06
  • 1
    when you compile the app, in the index.html file do you have `` inside the html tags? – mast3rd3mon May 09 '18 at 11:07

1 Answers1

-2

Add meta tag in the index.html. This is also a necessary line.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Please refer https://stackoverflow.com/a/6771584/7458082 for more infromation.

Basavaraj Bhusani
  • 5,375
  • 2
  • 16
  • 24