Skip to content

ng build --watch broken #2511

Closed
Closed

Description

@jonnysamps

OS?

Mac OSX (El Capitan)

Versions.

angular-cli: 1.0.0-beta.16
node: 6.7.0 (I also tried it on 5.12.0 and 4.6.0)
os: darwin x64

Repro steps.

  1. npm install -g angular-cli@latest
  2. ng new build-watch
  3. cd build-watch
  4. ng build -w

The log given by the failure.

Path must be a string. Received null
TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:1148:7)
    at Class.run (/Users/jonathansamples/projects/build-watch/node_modules/angular-cli/tasks/build-webpack-watch.js:14:26)
    at Class.run (/Users/jonathansamples/projects/build-watch/node_modules/angular-cli/commands/build.js:50:26)
    at Class.<anonymous> (/Users/jonathansamples/projects/build-watch/node_modules/angular-cli/lib/models/command.js:152:17)
    at tryCatch (/Users/jonathansamples/projects/build-watch/node_modules/rsvp/dist/lib/rsvp/-internal.js:215:12)
    at invokeCallback (/Users/jonathansamples/projects/build-watch/node_modules/rsvp/dist/lib/rsvp/-internal.js:230:13)
    at publish (/Users/jonathansamples/projects/build-watch/node_modules/rsvp/dist/lib/rsvp/-internal.js:198:7)
    at flush (/Users/jonathansamples/projects/build-watch/node_modules/rsvp/dist/lib/rsvp/asap.js:85:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Activity

  1. denkomanceski commented on Oct 4, 2016

    @denkomanceski

    same happens on Windows. There is one main reason why we would use ng build -watch over ng serve.. we need the generated map files on the disk instead of in-memory on the webpack dev server so we will be able to debug from webstorm..

  2. coryrylan commented on Oct 5, 2016

    @coryrylan
    Contributor

    @denkomanceski @jonnysamps to get around this run the following:
    ng build --watch -o dist/ Adding the out param seems to fix it. We use it as well because we proxy the site and need physical files on disk.

  3. jonnysamps commented on Oct 5, 2016

    @jonnysamps
    ContributorAuthor

    Good tip @splintercode. Works like a charm.

  4. AnthoniG commented on Oct 5, 2016

    @AnthoniG

    Unfortunately it does not seem to work for me.

    I have a directory called test. Inside this directory are two other directories. One for my electron program and the other an angular app built using ng new.

    Now I've set my angular-cli.json to output to "outDir": "../electron/src/gui"

    When I do a normal ng build, it creates the files as it should. However if I use ng build --watch with that directory and change anything, it does not update anything.

    Btw: I am using windows7 64bit

  5. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    on Oct 9, 2016
  6. added 2 commits that reference this issue on Oct 9, 2016
    b39a09c
    ec0cdb5
  7. added a commit that references this issue on Oct 14, 2016
    7ea6b6d
  8. added a commit that references this issue on Oct 19, 2016
    2f9dafe
  9. added a commit that references this issue on Nov 3, 2016
    9946c64
  10. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Sep 7, 2019
  12. added a commit that references this issue on May 29, 2026
    5b55fbf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions