PatrickJS-starter icon indicating copy to clipboard operation
PatrickJS-starter copied to clipboard

Getting Error while Using npm run build:aot

Open rahulrsingh09 opened this issue 9 years ago • 2 comments

Getting the following Error when running the following command npm run build:aot

D:\Angular2\Football>npm run build:aot

[email protected] build:aot D:\Angular2\Football npm run build:aot:prod

[email protected] build:aot:prod D:\Angular2\Football npm run clean:dist && npm run clean:aot && webpack --config config/webpack.pro d.js --progress --profile --bail

[email protected] clean:dist D:\Angular2\Football npm run rimraf -- dist

[email protected] rimraf D:\Angular2\Football rimraf "dist"

[email protected] clean:aot D:\Angular2\Football npm run rimraf -- compiled

[email protected] rimraf D:\Angular2\Football rimraf "compiled"

fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" Starting compilation using the angular compiler. Angular compilation done, starting webpack bundling. Error: Error encountered resolving symbol values statically. Calling function 'r equire', function calls are not supported. Consider replacing the function or la mbda with a reference to an exported function, resolving symbol CompetitionCompo nent in D:/Angular2/Football/src/app/competition/competition.component.ts, resol ving symbol CompetitionComponent in D:/Angular2/Football/src/app/competition/com petition.component.ts at SyntaxError.BaseError [as constructor] (D:\Angular2\Football\node_modules @angular\compiler\bundles\compiler.umd.js:1597:31) at new SyntaxError (D:\Angular2\Football\node_modules@angular\compiler\bund les\compiler.umd.js:1795:20) at simplifyInContext (D:\Angular2\Football\node_modules@angular\compiler\bu ndles\compiler.umd.js:25783:27) at StaticReflector.simplify (D:\Angular2\Football\node_modules@angular\comp iler\bundles\compiler.umd.js:25795:17) at StaticReflector.annotations (D:\Angular2\Football\node_modules@angular\c ompiler\bundles\compiler.umd.js:25291:64) at NgModuleResolver.resolve (D:\Angular2\Football\node_modules@angular\comp iler\bundles\compiler.umd.js:17771:86) at CompileMetadataResolver.getNgModuleMetadata (D:\Angular2\Football\node_mo dules@angular\compiler\bundles\compiler.umd.js:18272:64) at addNgModule (D:\Angular2\Football\node_modules@angular\compiler\bundles
compiler.umd.js:25053:62) at D:\Angular2\Football\node_modules@angular\compiler\bundles\compiler.umd. js:25064:18 at Array.forEach (native) at _createNgModules (D:\Angular2\Football\node_modules@angular\compiler\bun dles\compiler.umd.js:25063:30) at analyzeNgModules (D:\Angular2\Football\node_modules@angular\compiler\bun dles\compiler.umd.js:24938:18) at analyzeAndValidateNgModules (D:\Angular2\Football\node_modules@angular\c ompiler\bundles\compiler.umd.js:24948:39) at AotCompiler.compileAll (D:\Angular2\Football\node_modules@angular\compil er\bundles\compiler.umd.js:24672:22) at CodeGenerator.codegen (D:\Angular2\Football\modules@angular\compiler-cli \src\codegen.ts:41:10) at D:\Angular2\Football\node_modules\src\main.ts:15:84 at Object.main (D:\Angular2\Football\node_modules\tools@angular\tsc-wrapped \src\main.ts:60:12) at Object.runInternal (D:\Angular2\Football\node_modules\src\main.ts:20:10) at NgcWebpackPlugin.run (D:\Angular2\Football\node_modules\src\plugin.ts:79: 7) at Compiler. (D:\Angular2\Football\node_modules\src\plugin.ts:65: 53) at next (D:\Angular2\Football\node_modules\tapable\lib\Tapable.js:140:14) at Compiler. (D:\Angular2\Football\node_modules\awesome-typescrip t-loader\src\watch-mode.ts:7:13) at Compiler.applyPluginsAsyncSeries (D:\Angular2\Football\node_modules\tapab le\lib\Tapable.js:142:13) at D:\Angular2\Football\node_modules\webpack\lib\Compiler.js:214:8 at next (D:\Angular2\Football\node_modules\tapable\lib\Tapable.js:138:11) at Compiler.compiler.plugin (D:\Angular2\Football\node_modules\webpack\lib\n ode\NodeEnvironmentPlugin.js:21:4) at Compiler.applyPluginsAsyncSeries (D:\Angular2\Football\node_modules\tapab le\lib\Tapable.js:142:13) at Compiler.run (D:\Angular2\Football\node_modules\webpack\lib\Compiler.js:2 11:7) at processOptions (D:\Angular2\Football\node_modules\webpack\bin\webpack.js: 359:12) at Object. (D:\Angular2\Football\node_modules\webpack\bin\webpack .js:363:1)

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ node_modules\npm\bin\npm-cli.js" "run" "build:aot:prod" npm ERR! node v6.3.1 npm ERR! npm v3.10.3 npm ERR! code ELIFECYCLE npm ERR! [email protected] build:aot:prod: npm run clean:dist && n pm run clean:aot && webpack --config config/webpack.prod.js --progress --profil e --bail npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build:aot:prod script 'npm run clean:dist && npm run clean:aot && webpack --config config/webpack.prod.js --progress --profile --bail'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular2-webpack-star ter package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run clean:dist && npm run clean:aot && webpack --config config/ webpack.prod.js --progress --profile --bail npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-webpack-starter npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-webpack-starter npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! D:\Angular2\Football\npm-debug.log

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ node_modules\npm\bin\npm-cli.js" "run" "build:aot" npm ERR! node v6.3.1 npm ERR! npm v3.10.3 npm ERR! code ELIFECYCLE npm ERR! [email protected] build:aot: npm run build:aot:prod npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build:aot script 'npm run build:aot:prod'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular2-webpack-star ter package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run build:aot:prod npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-webpack-starter npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-webpack-starter npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! D:\Angular2\Football\npm-debug.log

rahulrsingh09 avatar Feb 08 '17 13:02 rahulrsingh09

Did you try using templateUrls and styleUrls instead of requiring HTML and css files?

Don’t use require statements for your templates or styles, use styleUrls and templateUrls, the angular2-template-loader plugin will change it to require at build time.

codingwithrachel avatar Feb 09 '17 14:02 codingwithrachel

Ya i was using in a template and i oversaw it as i have two systems and the code wasn't refractored. Thanks a lot , now it works fine . Closing the issue

rahulrsingh09 avatar Feb 09 '17 16:02 rahulrsingh09