material2-app icon indicating copy to clipboard operation
material2-app copied to clipboard

Module not found: Error: Can't resolve 'app.component.html' in '.../material2-app/src/app'

Open fidergo-stephane-gourichon opened this issue 7 years ago • 1 comments

After patching to avoid AoT compiling, see #28, after updating project with

npm-check-updates -u
npm install
npm update
npm install

It complains about not finding files that actually exist:

npm start


> [email protected] start .../material2-app
> ng serve

** NG Live Development Server is running on http://localhost:4200. **
Hash: cae9759af9d2ae4f4ffe
Time: 11522ms
chunk    {0} styles.bundle.js, styles.bundle.map (styles) 50.7 kB {3} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.map (main) 6.68 kB {2} [initial] [rendered]
chunk    {2} vendor.bundle.js, vendor.bundle.map (vendor) 3.59 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in MaterialAppModule is not an NgModule

ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve 'app.component.html' in '.../material2-app/src/app'
 @ ./src/app/app.component.ts 47:18-47
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve 'app.component.css' in '.../material2-app/src/app'
 @ ./src/app/app.component.ts 48:17-45
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi main
webpack: bundle is now VALID.

Based on https://github.com/angular/angular-cli/issues/3426 I tried

npm install --save [email protected]

Which solved ERROR in MaterialAppModule is not an NgModule

Then based on https://github.com/angular/angular-cli/issues/3426

npm install --save angular-cli

Which brought back the problem that was observed in #28;

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

Additional information

Ubuntu 16.04 AMD64

node --version

v6.9.2

{
  "name": "m2-app",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^2.0.0",
    "@angular/compiler": "^2.0.0",
    "@angular/core": "^2.0.0",
    "@angular/forms": "^2.0.0",
    "@angular/http": "^2.0.0",
    "@angular/material": "2.0.0-beta.1",
    "@angular/platform-browser": "^2.0.0",
    "@angular/platform-browser-dynamic": "^2.0.0",
    "@angular/router": "^3.0.0",
    "angular-cli": "^1.0.0-beta.24",
    "core-js": "^2.4.0",
    "rxjs": "5.0.2",
    "ts-helpers": "^1.1.1",
    "typescript": "^2.0.10",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^2.0.0",
    "@angular/platform-server": "^2.0.0",
    "@types/hammerjs": "^2.0.32",
    "@types/jasmine": "^2.2.30",
    "angular-cli": "^1.0.0-beta.16",
    "codelyzer": "~2.0.0-beta.4",
    "firebase-tools": "^3.0.7",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.7.0",
    "karma": "1.3.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-jasmine": "1.1.0",
    "karma-remap-istanbul": "^0.4.0",
    "protractor": "4.0.14",
    "ts-node": "2.0.0",
    "tslint": "4.2.0",
    "typescript": "^2.0.2"
  }
}

Now clueless. What to do?

Thanks.

I had same issue. After fixed all other things, i now got the 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)

n2lose avatar Jan 05 '17 08:01 n2lose