Currently, I am utilizing the Angular2 starter with webpackjs AMD. While there are no build errors showing up, I encounter some issues when browsing (using npm server), resulting in the following errors:
What aspects might I be overlooking in my build configuration? What other factors should I review to ensure everything runs smoothly?
Thank you in advance.
//error one
In long-stack-trace-zone.js:106, an Uncaught ReferenceError occurs where Zone seems to be undefined. This issue is preventing specific functionalities from working as expected. The trace further indicates dependencies failing to load properly, impacting the application's performance.
//error two
The use of class decorators demands reflection metadata shim for proper integration. Missing out on this crucial element leads to potential failures and inconsistencies in functionality across the application. It is essential to address this requirement to maintain stability.
//package.json
{
"name": "angular2",
"version": "1.0.0",
"description": "Angular 2",
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
},
"license": "ISC",
"devDependencies": {
"ts-loader": "^0.7.2",
"tsd": "^0.6.5",
"typescript": "^1.7.5",
"webpack": "^1.12.11",
"webpack-dev-server": "^1.14.1"
},
"dependencies": {
"angular2": "^2.0.0-beta.11",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.13",
"reflect-metadata": "^0.1.2",
"rxjs": "^5.0.0-beta.0",
"zone.js": "^0.6.5"
}
}
//ts.config
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules"
],
"filesGlob": [
"typings/**/*.ts",
"app/**/*.ts"
],
"files": [
"typings/angular2/angular2.d.ts",
"typings/tsd.d.ts",
"app/app.component.ts",
"app/boot.ts",
"app/vendor.ts"
],
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": true
}
}
//vendor.ts
// Polyfills
import 'es6-shim';
import 'es6-promise';
import 'zone.js/dist/long-stack-trace-zone';
import 'reflect-metadata';