Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from CommonJS to ESM for support for TypeDoc 0.27.x #23

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

blutorange
Copy link

@blutorange blutorange commented Nov 27, 2024

Switch from CommonJS to ESM to support TypeDoc 0.27.x. Up until now, this plugin was distributed as CommonJS. When it tries to require("typedoc"), that fails, since CommonJS can't require ESM modules and TypeDoc is now distributed as ESM.

[error] The plugin typedoc-plugin-mdn-links could not be loaded
[error] Error [ERR_REQUIRE_ESM]: require() of ES Module /home/user/foo/node_modules/typedoc/dist/index.js from /home/user/foo/node_modules/typedoc-plugin-mdn-links/dist/index.js not supported.
Instead change the require of /home/user/foo/node_modules/typedoc/dist/index.js in /home/user/foo/node_modules/typedoc-plugin-mdn-links/dist/index.js to a dynamic import() which is available in all CommonJS modules.

I tested it against Node.JS 18, which is, as far as I can tell, the lowest version that's still supported

@Gerrit0 Gerrit0 merged commit ab2d1b5 into Gerrit0:main Nov 27, 2024
@Gerrit0
Copy link
Owner

Gerrit0 commented Nov 27, 2024

Shoot, I thought I'd gotten all of the CJS plugins when migrating... thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants