pyodide / pyodide/sphinx-js

Extension Error (exception: 'sources')

Open
#166 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
290
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm trying to build Typescript documentation, but I'm getting this error when executing make html SPHINXOPTS=-v (local paths replaced with $env_path for privacy):

Traceback (most recent call last):
  File "$env_path/lib/python3.8/site-packages/sphinx/events.py", line 110, in emit
    results.append(listener.handler(self.app, *args))
  File "$env_path/lib/python3.8/site-packages/sphinx_js/__init__.py", line 60, in analyze
    app._sphinxjs_analyzer = analyzer.from_disk(abs_source_paths,
  File "$env_path/lib/python3.8/site-packages/sphinx_js/typedoc.py", line 40, in from_disk
    return cls(json, base_dir)
  File "$env_path/lib/python3.8/site-packages/sphinx_js/typedoc.py", line 29, in __init__
    ir_objects = self._convert_all_nodes(json)
  File "$env_path/lib/python3.8/site-packages/sphinx_js/typedoc.py", line 113, in _convert_all_nodes
    converted, more_todo = self._convert_node(todo.pop())
  File "$env_path//lib/python3.8/site-packages/sphinx_js/typedoc.py", line 154, in _convert_node
    constructor, members = self._constructor_and_members(node)
  File "$env_path/lib/python3.8/site-packages/sphinx_js/typedoc.py", line 100, in _constructor_and_members
    ir, _ = self._convert_node(child)
  File "$env_path/lib/python3.8/site-packages/sphinx_js/typedoc.py", line 190, in _convert_node
    first_sig['sources'] = node['sources']
KeyError: 'sources'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "$env_path/lib/python3.8/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "$env_path/lib/python3.8/site-packages/sphinx/application.py", line 278, in __init__
    self._init_builder()
  File "$env_path/lib/python3.8/site-packages/sphinx/application.py", line 337, in _init_builder
    self.events.emit('builder-inited')
  File "$env_path/lib/python3.8/site-packages/sphinx/events.py", line 117, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function analyze at 0x7f0ca88759d0> for event 'builder-inited' threw an exception (exception: 'sources')

Extension error:
Handler <function analyze at 0x7f0ca88759d0> for event 'builder-inited' threw an exception (exception: 'sources')

Versions:
TypeDoc 0.20.14
Using TypeScript 4.1.3 from /usr/lib/node_modules/typescript/lib
Sphinx 3.4.3
Sphinx-js 3.1

I tried debugging, but I'm new to typedoc, so I'm kind of stuck.
What I could tell was that it crashes when processing the constructor of my class, in typedoc.py kind == Constructor

Any idea where this is coming from?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with make html SPHINXOPTS=-v using the reported TypeDoc, TypeScript, Sphinx, and sphinx-js versions. Start in typedoc.py at _convert_node, especially the kind == Constructor path and the access to node['sources']; done means the documentation build no longer raises the sources KeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
documentation, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.