Sample project not running in ie11 windows 7

Issue

I am trying to run the following sample project :
https://github.com/montyr75/pdcl_first_elements

Its working in Chrome and Firefox but not working in IE 11.

In F12 developer tools console it giving this error :

File: index.bootstrap.initialize.dart.js, Line: 1483, Column: 15

I checked IE 11 on browserstack also, same issue.

I am using Eclipse Mars IDE.

So i tried a new project like below :

Pubspec.yaml

name: polymerdartsample
version: 1.0.0
author: tester
description: Sample web application
environment:
  sdk: '>=1.12.0 <2.0.0'
documentation: none
dependencies:
  polymer: 1.0.0-rc.15
  polymer_elements: 1.0.0-rc.8
  web_components: 0.12.2+2
transformers:
- polymer:
    entry_points: web/index.html

in index.html

<!DOCTYPE html>
<html>
<head>  
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src='packages/web_components/webcomponents-lite.js'></script>  
<link rel="import" href="packages/polymer_elements/roboto.html">
<title>Test Data</title>
</head>
<body unresolved>
<main-app></main-app>     
<script type="application/dart" src="index.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>

in index.dart

library polymerdartsample.web.index;
import 'package:polymerdartsample/main_app.dart';
import 'package:polymer/polymer.dart';
import 'dart:html';

main() async {
  await initPolymer();
}

in lib/main_app.html :

<dom-module id="main-app">
    <template>

        <h3>Hello world</h3>


    </template>
</dom-module>

in lib/main_app.dart :

@HtmlImport('main_app.html')

library polymerdartsample.lib.main_app;

import 'package:polymer/polymer.dart';
import 'package:web_components/web_components.dart';

@PolymerRegister('main-app')
class MainApp extends PolymerElement {

  MainApp.created() : super.created();

}

When I run this I get the same error in IE 11.

please help…

Solution

Use webcomponentsjs instead of webcomponents-lite.js in your index.html, because IE 11 does not support local dom yet ,but you must also know that webcomponents.js is slower than webcomponents-lite.js

cheers

Answered By – mardistal

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *