Skip to content

Typescript errors (cannot find module) when importing .md or .mdx files into a .tsx component #10640

@pburrows

Description

@pburrows

Have you read the Contributing Guidelines on issues?

Description

There is no documentation (or if there is, I cannot find it) of what needs to be modified in the tsconfig.json file to remove the "cannot find module" errors when importing .md or .mdx files into a .tsx page.

For sass modules (*.module.scss files), there is documentation on how to resolve these errors in typescript:
https://docusaurus.io/docs/styling-layout#typescript-support

I have no doubt the fix for .md and .mdx files are similar to the fix for sass, but it isn't obvious, and I haven't been able to figure out what docusaurus plugin item needs to be added to the tsconfig.json types to resolve these issues.

Examples of error:

image

Self-service

  • I'd be willing to address this documentation request myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: invalidThis issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way.documentationThe issue is related to the documentation of Docusaurus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions