Skip to content

fix: the current type module path confusing typescript tsc #1216

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tawago
Copy link

@tawago tawago commented Aug 18, 2025

Description

Resolves:

Motivation and Context

The type error:

node_modules/docusaurus-plugin-openapi-docs/src/types.ts:24:8 - error TS2307: Cannot find module '@docusaurus/plugin-content-docs-types' or its corresponding type declarations.

24 } from "@docusaurus/plugin-content-docs-types";

is really confusing because it seems like an official @docusaurus package in https://github.com/facebook/docusaurus/tree/main/packages but it's not. It gives an extra hurdle for typescript to resolve types.

NOTE: This PR does not address:

node_modules/docusaurus-plugin-openapi-docs/src/types.ts:8:32 - error TS2307: Cannot find module '@docusaurus/plugin-content-docs/src/sidebars/types' or its corresponding type declarations.

8 import { SidebarItemDoc } from "@docusaurus/plugin-content-docs/src/sidebars/types";

as "moduleResolution": "node" can solve it.

How Has This Been Tested?

Successfully ran commands to build the project and serve the demo

Types of changes

Bug fix / cleanup

A simple path update

  • packages/docusaurus-plugin-openapi-docs/src/types.ts
    Directly export from the type file
  • packages/docusaurus-plugin-openapi-docs/src/plugin-content-docs-types.d.ts

Checklist

  • I have updated the documentation accordingly. (not needed)
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate. (not needed)
  • All new and existing tests passed.

@tawago tawago changed the title use local import as the current module path confuses typescript fix: the current module path confusing typescript tsc Aug 18, 2025
@tawago tawago changed the title fix: the current module path confusing typescript tsc fix: the current type module path confusing typescript tsc Aug 18, 2025
@tawago tawago mentioned this pull request Aug 18, 2025
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.

1 participant