Skip to content

Can't run ng serve with latest master branch #1773

@mraible

Description

@mraible

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

OS X El Capitan

  1. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

I cloned the master branch and ran npm link in the cloned directory.

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

After running npm link, I created a new project with ng new ng2-demo. When I tried to run ng serve, I received the following error.

$ ng serve
 10% building modules 1/1 modules 0 active
*
*
 NG Live Development Server is running on http://localhost:4200.
*
1133ms building modules
2ms sealing
1ms optimizing
0ms basic module optimization
2ms module optimization
1ms advanced module optimization
3ms basic chunk optimization
0ms chunk optimization
0ms advanced chunk optimization
0ms module and chunk tree optimization
5ms module reviving
1ms module order optimization
1ms module id optimization
1ms chunk reviving
0ms chunk order optimization
3ms chunk id optimization
4ms hashing
0ms module assets processing
20ms chunk assets processing
1ms additional chunk assets processing
0ms recording
0ms additional asset processing
14ms chunk asset optimization
25ms asset optimization
11ms emitting
Hash: 96254c1f9bc487557b2b
Version: webpack 2.1.0-beta.18
Time: 1245ms
         Asset     Size  Chunks             Chunk Names
main.bundle.js   240 kB    0, 1  [emitted]  main
     inline.js  4.96 kB       1  [emitted]  inline
      main.map   293 kB    0, 1  [emitted]  main
    inline.map  5.13 kB       1  [emitted]  inline
    index.html  2.55 kB          [emitted]

ERROR in multi main
Module not found: Error: Can't resolve '/Users/mraible/ng2-demo/undefined/main.ts' in '/Users/mraible/ng2-demo/node_modules/angular-cli/addon/ng2/models'
 @ multi main

ERROR in Entry module not found: Error: Can't resolve '/Users/mraible/ng2-demo/undefined/polyfills.ts' in '/Users/mraible/ng2-demo/node_modules/angular-cli/addon/ng2/models'

ERROR in   Error: Child compilation failed:
  Entry module not found: Error: Can't resolve '/Users/mraible/ng2-demo/undefined/index.html' in '/Users/mraible/ng2-dem  o/node_modules/angular-cli/addon/ng2/models':
  Error: Can't resolve '/Users/mraible/ng2-demo/undefined/index.html' in '/Users/mraible/ng2-demo/node_modules/angular-c  li/addon/ng2/models'

  - compiler.js:76
    [ng2-demo]/[html-webpack-plugin]/lib/compiler.js:76:16

  - Compiler.js:251 Compiler.<anonymous>
    [ng2-demo]/[webpack]/lib/Compiler.js:251:10

  - Compiler.js:442
    [ng2-demo]/[webpack]/lib/Compiler.js:442:12

  - Tapable.js:81 next
    [ng2-demo]/[tapable]/lib/Tapable.js:81:11

  - CachePlugin.js:61 Compiler.<anonymous>
    [ng2-demo]/[webpack]/lib/CachePlugin.js:61:4

  - Tapable.js:85 Compiler.applyPluginsAsync
    [ng2-demo]/[tapable]/lib/Tapable.js:85:13

  - Compiler.js:439 Compiler.<anonymous>
    [ng2-demo]/[webpack]/lib/Compiler.js:439:9

  - Tapable.js:73 Compilation.applyPluginsAsync
    [ng2-demo]/[tapable]/lib/Tapable.js:73:70

  - Compilation.js:617 Compilation.<anonymous>
    [ng2-demo]/[webpack]/lib/Compilation.js:617:18

  - Tapable.js:73 Compilation.applyPluginsAsync
    [ng2-demo]/[tapable]/lib/Tapable.js:73:70

  - Compilation.js:608 Compilation.<anonymous>
    [ng2-demo]/[webpack]/lib/Compilation.js:608:10

  - Tapable.js:73 Compilation.applyPluginsAsync
    [ng2-demo]/[tapable]/lib/Tapable.js:73:70

  - Compilation.js:603 Compilation.<anonymous>
    [ng2-demo]/[webpack]/lib/Compilation.js:603:9

  - Tapable.js:73 Compilation.applyPluginsAsync
    [ng2-demo]/[tapable]/lib/Tapable.js:73:70

  - Compilation.js:599 Compilation.<anonymous>
    [ng2-demo]/[webpack]/lib/Compilation.js:599:8

  - Tapable.js:73 Compilation.applyPluginsAsync
    [ng2-demo]/[tapable]/lib/Tapable.js:73:70

  - Compilation.js:547 Compilation.seal
    [ng2-demo]/[webpack]/lib/Compilation.js:547:7

  - Compiler.js:436 Compiler.<anonymous>
    [ng2-demo]/[webpack]/lib/Compiler.js:436:15

  - Tapable.js:152
    [ng2-demo]/[tapable]/lib/Tapable.js:152:11

  - Compilation.js:434 Compilation.<anonymous>
    [ng2-demo]/[webpack]/lib/Compilation.js:434:10

  - Compilation.js:337 Compilation.errorAndCallback
    [ng2-demo]/[webpack]/lib/Compilation.js:337:3

  - Compilation.js:351 Compilation.<anonymous>
    [ng2-demo]/[webpack]/lib/Compilation.js:351:11


Child html-webpack-plugin for "index.html":

    ERROR in Entry module not found: Error: Can't resolve '/Users/mraible/ng2-demo/undefined/index.html' in '/Users/mraible/ng2-demo/node_modules/angular-cli/addon/ng2/models'
webpack: bundle is now VALID.
  1. Mention any other details that might be useful.

If I checkout a prior revision, it works.

git checkout 454286f96e5bc1a9b512a8f00da45baea7c9428a

454286f

$ ng serve
 10% building modules 1/1 modules 0 active
*
*
 NG Live Development Server is running on http://localhost:4200.
*
5923ms building modules
9ms sealing
1ms optimizing
0ms basic module optimization
14ms module optimization
0ms advanced module optimization
7ms basic chunk optimization
0ms chunk optimization
0ms advanced chunk optimization
0ms module and chunk tree optimization
62ms module reviving
5ms module order optimization
3ms module id optimization
3ms chunk reviving
1ms chunk order optimization
25ms chunk id optimization
21ms hashing
1ms module assets processing
79ms chunk assets processing
2ms additional chunk assets processing
0ms recording
0ms additional asset processing
130ms chunk asset optimization
1656ms asset optimization
40ms emitting
Hash: 3863e88ee7eabcf29434
Version: webpack 2.1.0-beta.18
Time: 8001ms
              Asset       Size  Chunks             Chunk Names
     main.bundle.js    2.54 MB    0, 2  [emitted]  main
polyfills.bundle.js     228 kB    1, 2  [emitted]  polyfills
          inline.js    4.96 kB       2  [emitted]  inline
           main.map       3 MB    0, 2  [emitted]  main
      polyfills.map     288 kB    1, 2  [emitted]  polyfills
         inline.map    5.13 kB       2  [emitted]  inline
         index.html  480 bytes          [emitted]
Child html-webpack-plugin for "index.html":
         Asset    Size  Chunks       Chunk Names
    index.html  2.4 kB       0
webpack: bundle is now VALID.

Node version 4.4.7 and npm version 3.10.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions