Skip to content

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Aug 25, 2025

The internal preprocess plugin deletes the transform hook if no preprocessors were configured in configResolved, but this causes an error if configResolved were to be executed again, e.g. the plugin is reused in a multiple build setup.

I found this issue in my publint vitepress setup (which is a weird setup, but maybe some frameworks also reuse plugins):

  vitepress v2.0.0-alpha.12

✗ building client + server bundles...
build error:
Cannot set properties of undefined (setting 'filter')
TypeError: Cannot set properties of undefined (setting 'filter')
    at BasicMinimalPluginContext.configResolved (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected]_/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js:35:28)
    at file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bj7gA1-0.js:36285:87
    at Array.map (<anonymous>)
    at resolveConfig (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bj7gA1-0.js:36285:68)
    at async createBuilder (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bj7gA1-0.js:34478:19)
    at async build$1 (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bj7gA1-0.js:34032:18)
    at async file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitepress/dist/node/chunk-3d7P_gGE.js:42551:20
    at async task (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitepress/dist/node/chunk-3d7P_gGE.js:41802:5)
    at async bundle (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitepress/dist/node/chunk-3d7P_gGE.js:42549:3)
    at async build (file:///Users/bjorn/Work/oss/publint/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitepress/dist/node/chunk-3d7P_gGE.js:46805:59)

bluwy added a commit to publint/publint that referenced this pull request Aug 28, 2025
@dominikg dominikg mentioned this pull request Aug 28, 2025
@dominikg dominikg merged commit 79a56c4 into main Sep 1, 2025
8 checks passed
@dominikg dominikg deleted the preprocess-plugin-rerun branch September 1, 2025 14:02
@github-actions github-actions bot mentioned this pull request Sep 1, 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.

2 participants