Skip to content

Vite Plugin incompatible with TSDown - PR fix included #359

Description

@methompson

When attempting to use vite-plugin-vuetify with a TSDown project, I get the following error:

[plugin vuetify:import] rolldown/runtime.js
TypeError: filter is not a function
    at TransformPluginContextImpl.transform (file:///Users/work/Desktop/work/myq-core-module/node_modules/vite-plugin-vuetify/dist/index.mjs:37:42)
    at plugin (file:///Users/work/Desktop/work/myq-core-module/node_modules/rolldown/dist/shared/bindingify-input-options-CorDub0q.mjs:1207:30)
    at plugin.<computed> (file:///Users/work/Desktop/work/myq-core-module/node_modules/rolldown/dist/shared/bindingify-input-options-CorDub0q.mjs:1675:18)

When digging around the code within the plugin, I found that the importPlugin function sets a variable for filter, but only assigns a value to it when configResolved is called. I found that if I use a default assignment like so:

let filter: (id: unknown) => boolean = createFilter();

I can get around the above error and I can build my project with tsdown and still use this plugin.

I've created a PR into the project here that attempts to resolve this issue and make the plugin compatible with tsdown: #358

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions