javascript - error TS2384: Overload signatures must all be ambient or non-ambient -
i'm trying configure new webpack + angular2 project , i'm getting errors:
when use "npm start", got lot of errors this:
error in ./~/reflect-metadata/reflect.ts (953,21): error ts2384: overload signatures must ambient or non-ambient. error in ./~/reflect-metadata/reflect.ts (985,21): error ts2384: overload signatures must ambient or non-ambient. error in ./~/reflect-metadata/reflect.ts (1021,21): error ts2384: overload signatures must ambient or non-ambient. error in /home/gchiara/desenvolvimento/honda/typings/globals/node/index.d.ts (2301,5): error ts2309: export assignment cannot used in module other exported elements.
here code:
package.json
{ "name": "app", "version": "1.0.0", "description": "app", "main": "index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1", "typings": "typings", "start": "webpack-dev-server --inline --progress --port 3000" }, "author": "", "license": "isc", "dependencies": { "@angular/common": "2.0.0-rc.4", "@angular/compiler": "2.0.0-rc.4", "@angular/core": "2.0.0-rc.4", "@angular/forms": "0.2.0", "@angular/http": "2.0.0-rc.4", "@angular/platform-browser": "2.0.0-rc.4", "@angular/platform-browser-dynamic": "2.0.0-rc.4", "@angular/router": "3.0.0-beta.1", "@angular/router-deprecated": "2.0.0-rc.2", "@angular/upgrade": "2.0.0-rc.4", "angular2-in-memory-web-api": "0.0.14", "angular2-template-loader": "^0.4.0", "core-js": "^2.4.1", "html-loader": "^0.4.3", "html-webpack-plugin": "^2.22.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.0.0-beta.6", "ts-loader": "^0.8.2", "typescript": "^1.8.10", "typings": "^1.3.2", "webpack": "^1.13.1", "webpack-dev-middleware": "^1.6.1", "webpack-dev-server": "^1.14.1", "webpack-merge": "^0.14.1", "zone.js": "^0.6.12" }, "devdependencies": { "concurrently": "^2.0.0" } }
webpack.config.js
var webpack = require('webpack'); var htmlwebpackplugin = require('html-webpack-plugin'); module.exports = { entry: { 'polyfills': './src/polyfills.ts', 'vendor': './src/vendor.ts', 'app': './src/app.ts' }, output: { filename: '[name].js' }, resolve: { extensions: ['', '.js', '.ts'] }, module: { loaders: [ { test: /\.ts$/, loaders: ['ts', 'angular2-template-loader'] }, { test: /\.html$/, loader: 'html' }, ] }, plugins: [ new webpack.optimize.commonschunkplugin({ name: ['app', 'vendor', 'polyfills'] }), new htmlwebpackplugin({ template: './src/index.html' }) ], devserver: { historyapifallback: true, stats: 'minimal' } }
polyfills.ts
import 'core-js/es6'; import 'reflect-metadata'; require('zone.js/dist/zone'); if (process.env.env === 'production') { // production } else { // development error['stacktracelimit'] = infinity; require('zone.js/dist/long-stack-trace-zone'); }
vendor.ts
// angular 2 import '@angular/platform-browser'; import '@angular/platform-browser-dynamic'; import '@angular/core'; import '@angular/common'; import '@angular/http'; import '@angular/router'; import 'rxjs';
app.ts
import { bootstrap } '@angular/platform-browser-dynamic'; import { enableprodmode } '@angular/core'; import { appcomponent } './app/app.component'; if (process.env.env === 'production') { enableprodmode(); } bootstrap(appcomponent, []);
app.component.ts
import { component } '@angular/core'; @component({ selector: 'app', templateurl: './app.component.html' }) export class appcomponent { }
the application run normally, got tons of errors in console. knows why?
thanks!
this occurs because of reflect-metadata@0.1.4.
downgrade reflect-metadata@0.1.3 avoid these errors moment!
Comments
Post a Comment