vuetifyjs / vuetifyjs/vuetify-loader

Vite Plugin incompatible with TSDown - PR fix included

Open
#359 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
511
Forks
90
PR merge metrics
No merged PRs in 30d

Description

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: https://github.com/vuetifyjs/vuetify-loader/pull/358

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/vite-plugin/src/importPlugin.ts and compare the linked PR #358 with the current filter initialization. Reproduce the reported failure in a TSDown project, then verify that the Vite plugin builds and runs without the filter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.