Skip to content

Extension Error (exception: 'sources') #166

@zapfdk

Description

@zapfdk

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions