question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected token and undefined variables problems and warnings

See original GitHub issue

Environment data

  • VS Code version: 1.53.0-insider(4a875e23d20b64504a818834f3fa4c40adb8d480)
  • Jupyter Extension version (available under the Extensions sidebar): v2020.12.414227025
  • Python Extension version (available under the Extensions sidebar): v2021.1.429416775-dev
  • OS (Windows | Mac | Linux distro) and version: MacOS Catalina 10.15.5 (19F101)
  • Python and/or Anaconda version: 3.9.1 64bit
  • Type of virtual environment used: venv (poetry env use python3)
  • Jupyter server running: Local

Expected behaviour

I expect list of problems and warnings reflect the actual code issues in notebook cells and when I click on particular problem it lands me to the correct place that should be changed.

Actual behaviour

I’m getting a lot of errors and warnings like this:

Screenshot 2020-12-22 at 22 00 16

All of the notices don’t seem to be relevant. They lead to wrong cells and it’s quite hard to understand what triggers these errors and warnings:

2020-12-22_22-02-42 (1)-min

In the same time, I can actually execute notebook without any errors.

Steps to reproduce:

  1. Notebook shown in the gif can be found here: https://github.com/roma-glushko/kaggle-wine-quality
  2. Open project in VC and wait until it indexed
  3. Try to run cells of the notebook

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Started kernel Python 3
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Error 2020-12-22 12:20:16: Jupyter Kernel Spec not found for a local connection
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Started kernel Python 3.9.1 64-bit ('.venv')
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/Projects/kaggle/kaggle-wine-quality/.venv/bin/python ~/.vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IanMatthewHuffcommented, Dec 23, 2020

@roma-glushko Glad that it helped!

1reaction
roma-glushkocommented, Dec 23, 2020

Hey @IanMatthewHuff thank you for replay 🙏

It actually helped to remove %%time directive from the cell:

Screenshot 2020-12-23 at 21 37 13

All errors are gone and only warnings are left. Interestingly if I return %%time back, then I could not reproduce these errors again 😌 The same goes for exported python file. It doesn’t have any error even when I add %%time back in place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >
Uncaught SyntaxError: Unexpected token : - Stack Overflow
"Uncaught SyntaxError: Unexpected token" error appearance when your data return wrong json format, in some case, you don't know you got wrong json...
Read more >
Have a JavaScript Unexpected Token Error? Check Your Syntax
The JavaScript's parser expects tokens and symbols in a particular order, with relevant values or variables in between. Often, an Unexpected ...
Read more >
Problem on 4/9: SyntaxError: Unexpected token . | Codecademy
“SyntaxError: Unexpected token .” It says I put a wrong period on line 2, but it's just part of Math.random() so I don't...
Read more >
JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Not follow them throws an error.An unexpected token occurs if JavaScript code has a missing or extra character { like, ) + –...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found