Skip to content

Package.json exports restriction breaks external plugins #1696

Closed
@mf-pherlihy

Description

@mf-pherlihy

Search Terms

  • exports
  • is not defined by "exports"
  • Package subpath

Problem

Prior to 0.22.0, you could import specific TypeDoc classes and functions that made plugin development simpler:

import { MarkdownEvent } from 'typedoc/dist/lib/output/events';
import { getRawComment } from 'typedoc/dist/lib/converter/factories/comment';

this.app.listenTo(
  this.app.renderer,
  MarkdownEvent.PARSE,
  (event: MarkdownEvent) => someHandler(event),
  eventPriority
);

However, in the 0.22.0 release a change was made to package.json which no longer allows this: 4f33ff8

"exports": "./dist/index.js",

Leading to this error:

Error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/lib/output/events' is not defined by "exports"

Suggested Solution

Remove exports from package.json

OR

While tedious, we could add any files that might be useful to external plugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions