Angular 2 CLI environment set up -
i want set development, test(qa) , prod environment angular 2 project. while going qa env set ng build --environment=qa
i getting below error
cannot read property 'length' of undefined @ createsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:15457:109) @ parsesourcefileworker (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:15389:26) @ object.parsesourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:15338:26) @ object.createsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:15192:29) @ virtualfilestats.getsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\@ngtools\webpack\src\compiler_host.js:66:35) @ webpackcompilerhost.getsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\@ngtools\webpack\src\compiler_host.js:213:38) @ findsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:67909:29) @ processimportedmodules (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:68056:25) @ findsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:67937:17) @ processsourcefile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:67840:27) @ processrootfile (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:67728:13) @ d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:67018:60 @ object.foreach (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:1449:30) @ object.createprogram (d:\ecc web\ecc web\working\8-aug\node_modules\typescript\lib\typescript.js:67018:16) @ aotplugin._setupoptions (d:\ecc web\ecc web\working\8-aug\node_modules\@ngtools\webpack\src\plugin.js:129:28) @ new aotplugin (d:\ecc web\ecc web\working\8-aug\node_modules\@ngtools\webpack\src\plugin.js:26:14)
below code environment set in angular-cli.json
"environments": { "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts", "qa": "environments/environment.qa.ts" } in environments/environment.qa.ts
export const environment = { production: false };
typescript wants read source file doesn't exist. stack trace doesn't mention name of missing file, can editing file node_modules\typescript\lib\typescript.js - add log statement console.log(filename); @ beginning of createsourcefile method , run build command again. last filename before error should 1 causing problem.
Comments
Post a Comment