-
Notifications
You must be signed in to change notification settings - Fork 121
How to debug both the API and the SPA? #36
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
Comments
I've got something working but it's a bit clumsy. Don't know if I'm doing something wrong.
Now 2 instances are started when I use the compound. One in already open firefox instance (with all my beloved add-ons including vue-devtools) and one fresh instance (without all the add-ons). Can you help me improve |
Hi, yesterday I tried to prepare You actually got one step further, because you managed to attach debugger. For me no matter what I do there are no symbols loaded. Even if I follow official Vue VS Code Debugging docs and open only Vue app without .NET Core, I can see messages from debug console from Chrome in VS Code, but breakpoints never hit with message "No symbols have been loaded for this document". Source maps are probably not loaded correctly, even if my folder configuration seams to be correct... 😞 For better configuration I would change browser from If someone has better configuration to debug both Vue and .NET Core apps feel free to share it 😃 |
This was actually relatively easy to get working (note, replace %% stuff with your application info) If you are on windows, simply set the chrome or firefox desktop shortcuts to run with the CLI arguments the debugger extensions require. If you are on Linux, find the .desktop links for chrome and firefox and add the arguments there so you don't have to launch them from the terminal every time. I use elementaryOS - the desktop files are located in Let me know if you run into any issues. YMMV
|
I'll try again tomorrow but I never managed to attach, I always get the same error about connection refused (I'll update with the exact error), even when using the chrome debugger plugin. |
I have gotten that before with Angular. Chrome itself uses a specific port for debugging, so you may have been missing that when launching it. |
I found the settings for the ECONNREFUSED error but I'm unable to debug anything vue using attach. I remember looking into https://github.com/DaniJG/ASPCoreVueCLITemplates, I'll see if I can work out a solution from there combined with this template.. UPDATE: the |
Interesting. I cannot say I had the same issues you did. As soon as I corrected my sourcemap pathing it started to work, even without setting a breakpoint in C#. |
The I found a discussion about debugging in VS Code with TS Vue apps which seems to not work the same as JS projects here. EDIT: Configuration from the issue above seems to be working and breakpoints hit also in *.vue files with TS: (Only for chrome
|
I am not sure why Chrome is bugging out. I should have specified that my project is TS based, which is why it was working for me with that setup. The source map overrides above are better than directly specifying the folder like I am doing as well. Edit: Also - Vetur does not like it when the root folder of the workspace isn't the vue app. No intellisense and lots of "errors" that aren't actually there. Debugging this way can be a pain. I am trying to get a workaround going. |
Got a workaround going. This may be a pain for some, but here it goes. Edit: You will also have to "start" the app from the other VS Code instance that is open with the .net project in it, then use the other instance to start debugging in chrome.
|
You can use Vue-DevTools. https://github.com/vuejs/vue-devtools https://github.com/vuejs/vue-devtools import { register } from 'register-service-worker'; if (process.env.NODE_ENV === 'production') { For instruction see: |
Works quite well for me. |
Thanks for the template! 🙇
Any idea how to debug both the API and the SPA?
I've been fiddling with the launch.json file but I can't get it to work.
I'm using Linux, VS Code & Firefox.
The text was updated successfully, but these errors were encountered: