Error loading calico-spell-check extension

Issue #209 resolved
Marc Mollà Roselló created an issue

When I tried to load the calico-spell-check nbextension I saw the following error in the js console:

cannot read property ' model ' of undefined

The problems seems to be in the line:

document.original_heading_mode = IPython.HeadingCell.options_default.cm_config.mode

that fails due to IPython.HeadingCell.options_default has not cm_config attribute.

I changed this line by:

document.original_heading_mode = "gfm"

and it works well.

Install data:

platform : linux-64 Python 3.4.1 |Anaconda 2.1.0 (64-bit) IPython 2.2.0

Comments (9)

  1. Doug Blank

    Are you running from the downloads, or from master? I believe that this is fixed in master. Need to make updated downloads.

  2. Marc Mollà Roselló reporter

    I am running from the downloads.

    I just tried the calico-spell-check.js from the repository but I received the same error (it also contains the line that fails in my ipython: document.original_heading_mode = IPython.HeadingCell.options_default.cm_config.mode)

  3. Doug Blank

    This sounds like a timing issue where IPython.HeadingCell.options_default hasn't been initialized yet. You can, as you have suggested, just hard-code the original mode. But it sometimes changes. The correct solution will be to not set the original until after IPython has finished initialization. I'll see if we can add something else in the require....

  4. Marc Mollà Roselló reporter

    I tested with an open notebook and I received the same error. Is it possible that my IPython version has not this attribute?

    %%javascript
    alert(IPython.HeadingCell.options_default.cm_config.mode)
    
    Javascript error adding output!
    TypeError: Cannot read property 'mode' of undefined
    See your browser Javascript console for more details.
    
  5. Log in to comment