Skip to content

Conversation

@inngineer
Copy link

@inngineer inngineer commented Jan 26, 2026

Vite 6 changed how it invokes plugin hooks - the config hook no longer receives the plugin context (this). This causes 'TypeError: undefined is not an object (evaluating this.meta)' when using Vite 6.

This fix adds a null check for 'this' before accessing this.meta to maintain compatibility with both Vite 5 and Vite 6.

Fixes: TypeError when starting Vite 6 dev server
Tested with: Vite 6.4.1, vite_ruby 3.9.2, Rails 8.0.4

Vite 6 changed how it invokes plugin hooks - the config hook no longer
receives the plugin context (this). This causes 'TypeError: undefined is
not an object (evaluating this.meta)' when using Vite 6.

This fix adds a null check for 'this' before accessing this.meta to
maintain compatibility with both Vite 5 and Vite 6.

Fixes: TypeError when starting Vite 6 dev server
Tested with: Vite 6.4.1, vite_ruby 3.9.2, Rails 8.0.4
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.

1 participant