Skip to content

Commit 05ef2f0

Browse files
authored
Filter all Remix vite plugins before passing to vite-node (#1369)
1 parent ed67731 commit 05ef2f0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/hip-zebras-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/vite-plugin': patch
3+
---
4+
5+
Fixes a bug where an internal Remix plugin would throw an error inside the `vite-node` compiler

packages/vite-plugin/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ export function vanillaExtractPlugin({
146146
// If it _is_ loaded with a config file, it will create an infinite loop because it
147147
// also has a child compiler which uses the same mechanism to load the config file.
148148
// https://github.com/remix-run/remix/pull/7990#issuecomment-1809356626
149-
plugin.name !== 'remix',
149+
// Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
150+
// the main Remix plugin, and may not function correctly without it. To address this, we
151+
// filter out all Remix-related plugins.
152+
!plugin.name.startsWith('remix'),
150153
),
151154
},
152155
});

0 commit comments

Comments
 (0)