Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: vitest merge config in form of callback #701

Closed
wants to merge 1 commit into from

Conversation

DingYuanhao
Copy link

I got an vitest error using create-vue template:

Error: Vitest failed to start:
Error: Cannot merge config in form of callback
at mergeConfig (file://...)

Fixed it according to vitest's official documentation

image

@haoqunjiang
Copy link
Member

But our vite config isn't defined as an function. Would you please open an issue with a runnable reproduction?

@DingYuanhao
Copy link
Author

But our vite config isn't defined as an function. Would you please open an issue with a runnable reproduction?

Sorry, my mistake 😅 The issue lies with my vite.config.ts file, where I defined the Vite config in a functional way. I thought that defining the Vite config as mentioned in the PR would make it more universal. However, in this case, if it is not defined as a function, a new TypeScript error would be raised, even though Vitest runs successfully. Feel free to close the PR anyway :)

@haoqunjiang haoqunjiang closed this Mar 2, 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