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.

Native Notebooks - Error loading preloads: Cannot read property 'src' of null

See original GitHub issue

Environment data

  • VS Code version: 1.51.0-insider
  • Extension version (available under the Extensions sidebar): v2020.11.311084263-dev
  • OS and version: Darwin x64 19.6.0
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.6, conda
  • Type of virtual environment used : Conda
  • Relevant/affected Python packages and their versions: Altair=4.1.0
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Value of the python.languageServer setting: pylance

With the new Native Notebook and default “Jupyter Notebook Renderer”, I’m getting some error’s when trying to view plots as pngs, with both R/ggplot and Python/altair.

  • Altair: if I change the render from ‘mimetype’ (png) to html the chart outputs fine.

  • R/ggplot: the chart will display if I change to the builtin png renderer.

Screen Shot 2020-10-31 at 08 24 40 Screen Shot 2020-10-31 at 08 25 50

Expected behaviour

Chart output png images are displayed.

Actual behaviour

Error loading preloads: Cannot read property ‘src’ of null

Steps to reproduce:

import altair as alt
import pandas as pd

# doesn't work with png
alt.renderers.enable('mimetype')

# does work with html
# alt.renderers.enable('html')

source = pd.DataFrame({
    'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
    'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]})

alt.Chart(source).mark_bar().encode(
    x='a',
    y='b')

Logs

attached native notebook png output issue.txt

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaymegordocommented, Nov 3, 2020

@DonJayamanne In the screenshots I added, you can see the text “Select output mimetype to render for current output”.

For R cells only, I wanted to see if I could switch the default from “Jupyter Notebook Renderer” (doesn’t work) to “built-in” (does work), as a temp work around only while this issue is being worked on. Its not a huge deal, was just curious.

In general the new Native Notebooks are amazing though, thanks for all the work you guys put in!!

0reactions
DonJayamannecommented, Feb 23, 2021

Been a few months since this was fixed hence closing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error loading preloads: Cannot read property 'src' of null · ...
With the new Native Notebook and default "Jupyter Notebook Renderer", I'm getting some error's when trying to view plots as pngs, with both...
Read more >
python - Error loading preloads: Could not find renderer
In my case, I had Jupyter notebook extension installed. So, I did ctrl+shift+P and did Reload window ; resolved!
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Cant load libsandbox.so ... no such file" status:RESOLVED resolution:FIXED ... Bug:2298 - "vanilla-sources ebuild replaces /usr/src/linux symlink without ...
Read more >
npm install cannot read property 'insert' of undefined
This error can occur when trying to install a package with npm. The most common cause of this error is that the package...
Read more >
Unable to set property 'src' of undefined or null reference
Your script is trying to find an element with a "name" attribute of "slideshow". Since one does not exist, you receive the error....
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