jelbourn / material2-app

Simple app that consumes Angular Material 2 components
651 stars 280 forks source link

aot folder missing from repo #17

Open ghost opened 7 years ago

ghost commented 7 years ago

Getting the following error when building:

ERROR in ./src/main.ts Module not found: Error: Can't resolve './aot/app/app.module.ngfactory' in 'c:\Checkouts\material2-app\src' @ ./src/main.ts 8:0-76 @ multi main

ysarah commented 7 years ago

https://angular.io/docs/ts/latest/cookbook/aot-compiler.html use below command material2-app-master\node_modules.bin>ngc -p ../../src/tsconfig.json

BCusack commented 7 years ago

If your not using the "AOT" compiler in dev just go into the main.ts and comment out the last three lines

//import {platformBrowser} from '@angular/platform-browser'; //import {MaterialAppModuleNgFactory} from './aot/app/app.module.ngfactory'; //platformBrowser().bootstrapModuleFactory(MaterialAppModuleNgFactory);

and uncomment the three lines above (the module bootstrap lines).
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {MaterialAppModule} from './app/app.module'; platformBrowserDynamic().bootstrapModule(MaterialAppModule);

n2lose commented 7 years ago

@BCusack : I have tried it, but it still fire another error:

patterns.map is not a function
TypeError: patterns.map is not a function
    at GlobCopyWebpackPlugin.apply (E:\projects\angular2\material2-app-master\node_modules\angular-cli\plugins\glob-copy-webpack-plugin.js:16:29)
    at Compiler.apply (E:\projects\angular2\material2-app-master\node_modules\tapable\lib\Tapable.js:270:16)
    at WebpackOptionsApply.process (E:\projects\angular2\material2-app-master\node_modules\webpack\lib\WebpackOptionsApply.js:59:18)
    at webpack (E:\projects\angular2\material2-app-master\node_modules\webpack\lib\webpack.js:28:48)
    at Class.run (E:\projects\angular2\material2-app-master\node_modules\angular-cli\tasks\serve-webpack.js:38:27)
    at E:\projects\angular2\material2-app-master\node_modules\angular-cli\commands\serve.js:108:26
    at process._tickCallback (internal/process/next_tick.js:103:7)
wnick1 commented 7 years ago

about solving the issue of "patterns.map is not a function" you should look into https://github.com/angular/angular-cli/issues/3566

Newbieee commented 7 years ago

Thank you @BCusack it fixed the issue. I should have seen it earlier

@wnick1 Thanks for the info. I was facing the same issue. Your direction helped to get rid of it.