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

Debug an Angular application in a Vagrant container #683

Open
nelson777 opened this issue Jun 14, 2021 · 2 comments
Open

Debug an Angular application in a Vagrant container #683

nelson777 opened this issue Jun 14, 2021 · 2 comments

Comments

@nelson777
Copy link

Hello,

TL;DR: How do I setup debug for an angular application inside a Vagrant container ? all debug instructions I could found presumed non-containerized use. Has someone been able to debug inside a container ?

Long story:

I'm using WWD for some time now and like it a lot. But I've never been able to setup debug correctly. It really didn't matter much because console.log and alerts were enough until now.
But recently I had a bug on the keycloak enabled app-init of my application. So the app just reloaded everytime and I had to excessively use alerts with JSON.stringify to debug it. This is rather inefficient.
So this made me feel it's about time for me to setup debug correcty.

I've seens these instructions:

#661
https://github.com/eclipse/wildwebdeveloper/blob/master/TIPS_and_FAQ.md
#566
#111

I've also seen this question on SO:

https://stackoverflow.com/questions/25617323/can-i-debug-angularjs-and-typescript-in-eclipse

But as I said all of them presume host, non-containerised usage.

Any help appreciated. Thanks.

@mickaelistria
Copy link
Contributor

Good news is that I'm almost certain this is achievable in a way or another; although some options may not yet be available in Wild Web Developer, so that might involve some hacks.
Before we go into details, can you please clarify whether you're actually trying to connect to a running application (in the container) from the IDE, or whether you're trying to start the application from the IDE to the container?

@nelson777
Copy link
Author

Well... it would be better if I could connect to the running container as currently to start the application in my development environment I run the container then I open 2 terminals for backend and frontend and "vagrant ssh" to them. Then I run a package.json task in each to start them both. Here are the package json lines that I run to start it:

frontend:
"dev": "ng serve --watch --live-reload=false --source-map=false --ssl --ssl-cert localhost.crt --ssl-key localhost.key --host 0.0.0.0",
(I know that for this to work I will have to activate source-map)

backend:
"dev": "yarn nodemon src/server.js -L",

I say that it would be better, because to start the application's frontend the first time it takes a much longer time than the recompilation with live-reload. But if it's not possible it's not a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants