Using alpha.1 with webpack you might run into this kind of error:
ERROR in ./~/@angular2-material/core/annotations/one-of.ts
Module parse failed: /opt/senergy/iris-app/node_modules/@angular2-material/core/annotations/one-of.ts Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import {isPresent} from 'angular2/src/facade/lang';
|
|
@ ./~/@angular2-material/sidenav/sidenav.js 24:15-52
ERROR in ./~/@angular2-material/core/rtl/dir.ts
Module parse failed: /opt/senergy/iris-app/node_modules/@angular2-material/core/rtl/dir.ts Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import {EventEmitter} from 'angular2/src/facade/async';
| import {Directive, HostBinding, Output, Input} from 'angular2/core';
| import {OneOf} from '../annotations/one-of';
@ ./~/@angular2-material/sidenav/sidenav.js 23:12-38
The cause is that the compiled sidnav.js and dir.js tries to require the ts files instead of the compiled js ones.
Workaround
Open dir.js and locate the line
var one_of_1 = require('../annotations/one-of');
(around line 12) and add the js extension to the req'd module, so it should look like this
var one_of_1 = require('../annotations/one-of.js');
Do the same in sidenav.js, i.e. make sure you have something like this around line 23-24
var dir_1 = require('../core/rtl/dir.js');
var one_of_1 = require('../core/annotations/one-of.js');
Using
alpha.1withwebpackyou might run into this kind of error:The cause is that the compiled
sidnav.jsanddir.jstries to require the ts files instead of the compiled js ones.Workaround
Open
dir.jsand locate the line(around line 12) and add the js extension to the req'd module, so it should look like this
Do the same in
sidenav.js, i.e. make sure you have something like this around line 23-24