Skip to content

Type 'Plugin' is not assignable to type 'PluginOption'. #2646

@Asjas

Description

@Asjas

Initial checklist

Affected package

@mdx-js/rollup 3.1.1

Steps to reproduce

In the latest version of Vite 7.1.9 the latest version of @mdx-js/rollup 3.1.1 throws a plugin type error.

Actual behavior

In the latest version of Vite 7.1.9 the @mdx-js/rollup throws the following type error.

No overload matches this call.
  The last overload gave the following error.
    Type 'Plugin' is not assignable to type 'PluginOption'.
      Type 'Plugin' is not assignable to type 'Plugin$1<any>'.
        Types of property 'transform' are incompatible.

Expected behavior

There should be no type error. For now I am casting the plugin to the type PluginOptions from vite.

import type { PluginOption } from "vite";
mdx({
  remarkPlugins: [remarkGfm],
  rehypePlugins: [
    rehypeHighlight,
    rehypeSlug,
    [
      rehypeAutolinkHeadings,
      {
        behavior: "wrap",
        properties: {
          className: "no-underline scroll-mt-40",
        },
      },
    ],
  ],
  providerImportSource: "@mdx-js/react",
  include: ["**/*.mdx"],
}) as PluginOptions,

Runtime

[email protected]

Package manager

[email protected]

Operating system

Fedora Workstation 42

Build and bundle tools

Vite

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🤷 no/invalidThis cannot be acted upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions