Giter VIP home page Giter VIP logo

Comments (11)

kenjioman avatar kenjioman commented on May 29, 2024 1

I just tried this on Jupyter Lab 1.0.2, and still, my markdown cells show nothing. This is for regular markdown cells -- I haven't even gotten to the point of testing the mermaid/etc additional features this extension is supposed to provide. When I disable the extension and reload the page, these markdown cells go back to being displayed.

And, no worries about not having time! At this stage, this is more of a nice-to-have/novelty feature than something that I daily depend on.

from jupyterlab-markup.

agoose77 avatar agoose77 commented on May 29, 2024 1

@RobertoMaurizzi Thanks for all the troubleshooting work!

@Memento1990 @kenjioman this issue makes more sense to me now, as I had to reinstall the extension on a fresh system.

The way in which webpack bundles the wasm code for this extension means that the system needs to understand the mimetype of the file when serving it to the browser. By default, most systems do not provide this mimetype. In the install instructions I provide a small bash script to register this mimetype on Linux (in /etc/mime.types). Other systems may have different mechanisms for doing this.

from jupyterlab-markup.

RobertoMaurizzi avatar RobertoMaurizzi commented on May 29, 2024 1

Addition on what to do exactly since every time Apple releases an update for their OS I fumble half an hour to get this working:

  1. add wasm to /etc/mime.types (I'm using a link to /etc/apache/mime.types, it might be it's better to copy the file but it's risky: what if they use it for something else and they change/add types?)
  2. restart JupyterLab
  3. clear your browser cache (I open the devtools, go to network, filter for wasm, get the only wasm request, check it's binary/octet-stream then use the menu to "clear browser cache" for that request.
  4. force-reload the page and it works

from jupyterlab-markup.

agoose77 avatar agoose77 commented on May 29, 2024

I've noticed that markdown cells sometimes need to be re-rendered (by editing and hitting CTRL+ENTER), have you tried this?

from jupyterlab-markup.

kenjioman avatar kenjioman commented on May 29, 2024

CTRL+ENTER didn't do anything for me -- the cells still show nothing (with a small blue bar on the left to indicate I have this cell selected). Running Jupyter Lab Version 0.35.3

from jupyterlab-markup.

agoose77 avatar agoose77 commented on May 29, 2024

I don't have time to look at this at the moment. I can't seem to reproduce the issue my end unfortunately. I used to use JupyterLab 0.35.6, and now use 1.0.2. Could you try either the latest JupyterLab, or 0.35.6, and see if it works there?

from jupyterlab-markup.

Memento1990 avatar Memento1990 commented on May 29, 2024

I got the error on JupyterLab 0.35.4, and recently have no plan to update JupyterLab. Agree on the upstairs's option, and no worries about this. 😄

from jupyterlab-markup.

RobertoMaurizzi avatar RobertoMaurizzi commented on May 29, 2024

I'm still seeing this on Jupyterlab 1.1.2. I'm on OSX and there's no mime.types file I can find to add wasm to.
In the browser (Chrome 76.0.3809.132) console I get a

Uncaught (in promise) TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

while Firefox has a more generic but similar TypeError: Response has unsupported MIME type.

From a cursory investigation it looks like there's no way to specify mime types on OSX (or at least not anymore: the recommended solution of using RCDefaultApp doesn't show me a panel for mime types anymore. I tried to investigate what Jupyter and Python are doing with regard to recognizing mime types and apparently application/wasm was added (to lib/mimetypes.py, see https://bugs.python.org/issue34758) a while ago but I'm not sure which specific releases included it right now (my 3.6.5 surely doesn't).

UPDATE: I installed JupyterLab and the rest in a virtualenv based on Python 3.7.4 and it's still the same, mimetypes can't understand what to do with .wasm. Currently Trying 3.8-dev (using pyenv)

from jupyterlab-markup.

RobertoMaurizzi avatar RobertoMaurizzi commented on May 29, 2024

So, with 3.7.4:

>>> import mimetypes
>>> mimetypes.guess_type('file://home/roberto/testfile.wasm')
(None, None)

while on 3.8.0b4+

>>> import mimetypes
>>> mimetypes.guess_type('file://home/roberto/testfile.wasm')
('application/wasm', None)

from jupyterlab-markup.

RobertoMaurizzi avatar RobertoMaurizzi commented on May 29, 2024

I ended up linking apache's mime.types file in /etc/mime.types and adding wasm as per instructions: python's mimetypes picks it up and the above test now prints the correct result also with Python 3.7.4.
Now I need to hope this won't kill OSX's UI at the next login... 😅

Jupyter still didn't render markdown cells, but it turned out that it had the wasm code request cached with the wrong (actually, missing) mime-type: after a cache clear now I can see Markdown cells again and they can render both bob and mermaid graphics :-)

Thank you for this extension, it makes writing process documentation in Jupyterlab so much easier! :-)

from jupyterlab-markup.

agoose77 avatar agoose77 commented on May 29, 2024

Closed due to above reason :)

from jupyterlab-markup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.