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: build failing with Vite 3 #1451

Merged
merged 1 commit into from Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/vite-node/src/server.ts
Expand Up @@ -25,7 +25,8 @@ export class ViteNodeServer {
public server: ViteDevServer,
public options: ViteNodeServerOptions = {},
) {
// @ts-expect-error ssr is not typed
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore ssr is not typed in Vite 2, but defined in Vite 3, so we can't use expect-error
const ssrOptions = server.config.ssr
if (ssrOptions) {
options.deps ??= {}
Expand Down
3 changes: 2 additions & 1 deletion packages/vitest/src/node/config.ts
Expand Up @@ -94,7 +94,8 @@ export function resolveConfig(
// vitenode will try to import such file with native node,
// but then our mocker will not work properly
if (resolved.deps.inline !== true) {
// @ts-expect-error ssr is not typed
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore ssr is not typed in Vite 2, but defined in Vite 3, so we can't use expect-error
const ssrOptions = viteConfig.ssr || {}

if (ssrOptions.noExternal === true && resolved.deps.inline == null) {
Expand Down