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

Using vagrant vm and proxying with nginx getting error : [WDS] Disconnected! #1753

Closed
denisprsa opened this issue Aug 19, 2016 · 5 comments
Closed

Comments

@denisprsa
Copy link

On my mac i'm using vagrant (ubuntu) as virtual environment , and when running command npm serve i get two bugs.

First one is on browser. WebSocket URL is not correct, because its trying to send data to localhost:4200, even though i'm on 192.168.100.100/

Second one, Webpack is not reloading after file change. I have created multiple new boxes and it wont work. I have installed webpack cli sudo npm install -g angular-cli@webpack

@denisprsa
Copy link
Author

OK, i didn't know for flag --host 0.0.0.0, so there's no more errors for websockets.
Anyway after changing files, local access gets recompiled. But if i access from my mac, to vagrant ip, page does not get recompiled. Websocket connection is established fine.

@filipesilva
Copy link
Contributor

I can leave the issue open so other people can try and help out, but this sounds an awful lot like a Vagrant config issue and I just don't know a lot about that. If you uncover a solution that reveals a bug in the CLI I'm happy to look at a PR, but as is there isn't much I can do.

@LeviRosol
Copy link

@sylar9232 you just solved my issue! I had no idea the 0.0.0.0 host setting would ultimately allow livereload to work for me in a vagrant setup. Because of this I now have a fully functional angular-cli project running on vagrant.

With that, I can help you in your issue with vagrant not picking up your changes.

Start by setting up vagrant-fsnotify: https://github.com/adrienkohlbecker/vagrant-fsnotify

FWIW, I would suggest using the following in your Vagrantfile:

config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp', 'fsc', 'actimeo=1'], fsnotify: true, exclude: ["node_modules"]

That exclude bit is one of the more important bits and makes a 10 fold decrease in the notification timing.

Also worth mentioning, if you only use 1024 mb of ram for your vm, the recompile is pretty slow. It appears using 2048mb is sufficient.

@filipesilva
Copy link
Contributor

Now that I'm re-reading this issue, I'm reminded of this PR, made to address something similar: #1814

This, and @LeviRosol's comment should address your file changes issue.

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants