Skip to content

Debugging in VS Code Cookbook Recipe #663

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

Merged
merged 2 commits into from
Nov 1, 2020
Merged

Conversation

sdras
Copy link
Member

@sdras sdras commented Oct 31, 2020

No description provided.

@sdras sdras added content Issues / PRs related to docs content cookbook labels Oct 31, 2020
Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Sarah, this looks perfectly good to me! 🎉

@NataliaTepluhina NataliaTepluhina merged commit 572b3cc into master Nov 1, 2020
Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this has already been merged but here are some thoughts from me.

devtool: 'source-map',
```

If you use Vue CLI 3, set or update the `devtool` property inside `vue.config.js`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be updated to Vue CLI 4?

Is mentioning CLI 2 still worthwhile in a Vue 3 context?

### Launching the Application from VS Code

::: info
We're assuming the port to be `8080` here. If it's not the case (for instance, if `8080` has been taken and Vue CLI automatically picks another port for you), just modify the configuration accordingly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stumbled a bit on this. Specifically the 'If it's not the case' part.

To my ear, it should be either 'If that's not the case' or just 'If it's not'.


## Setting a Breakpoint

1. Set a breakpoint in **src/components/HelloWorld.vue** on `line 90` where the `data` function returns a string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultra pedantic, but the function is returning an object, not a string.


### Vue Devtools

There are other methods of debugging, varying in complexity. The most popular and simple of which is to use the excellent Vue.js devtools [for Chrome](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) and [for Firefox](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/). Some of the benefits of working with the devtools are that they enable you to live-edit data properties and see the changes reflected immediately. The other major benefit is the ability to do time travel debugging for Vuex.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem to be links to the Vue 2 devtools. Do they need changing to the Vue 3 devtools beta?


The example above has a great workflow. However, there is an alternative option where you can use the [native debugger statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) directly in your code. If you choose to work this way, it's important that you remember to remove the statements when you're done.

```js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language doesn't currently match the code. Either the language needs changing or the <script> wrapper should be removed.

@DannyFeliz
Copy link

@skirtles-code can you make a PR with your suggestions? so we don't lose them.

nick-lai pushed a commit to nick-lai/docs-next that referenced this pull request Dec 2, 2020
* add in debugging in vscode

* change tips to new format
@NataliaTepluhina NataliaTepluhina deleted the sd/vscode-cookbook branch February 24, 2021 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues / PRs related to docs content cookbook
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants