Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build --watch broken #2511

Closed
jonnysamps opened this issue Oct 4, 2016 · 5 comments
Closed

ng build --watch broken #2511

jonnysamps opened this issue Oct 4, 2016 · 5 comments
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@jonnysamps
Copy link
Contributor

jonnysamps commented Oct 4, 2016

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)
@denkomanceski
Copy link

denkomanceski commented Oct 4, 2016

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..

@coryrylan
Copy link
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.

@jonnysamps
Copy link
Contributor Author

Good tip @splintercode. Works like a charm.

@AnthoniG
Copy link

AnthoniG commented Oct 5, 2016

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

@filipesilva filipesilva added type: bug/fix command: build P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Oct 9, 2016
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Oct 9, 2016
JJayet pushed a commit to JJayet/angular-cli that referenced this issue Oct 14, 2016
Brocco pushed a commit that referenced this issue Oct 19, 2016
texel pushed a commit to splice/angular-cli that referenced this issue Nov 3, 2016
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants