vitest-dev / vitest-dev/vitest

(0 , __vite_ssr_import_0__.defineVaporComponent) is not a function

Open
#9,402 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 21h
Merged PRs (30d)
92

Description

Describe the bug

VaporInteropPlugin has been set up in Vue Main

Image

After adding vapor to the script in Vue SFC, running Vitest to execute the test results in an error

<script setup vapor lang="ts">
Image

vue SFC script remove vapor

<script setup lang="ts">
Image
Reproduction

vue-vapor-component

System Info
System:
    OS: Windows 11 10.0.26200
    CPU: (16) x64 AMD Ryzen 7 5700U with Radeon Graphics
    Memory: 2.66 GB / 15.34 GB
  Binaries:
    Node: 22.16.0 - D:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - D:\Program Files\nodejs\npm.CMD
    pnpm: 10.26.2 - D:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Chrome: 143.0.7499.170
    Edge: Chromium (140.0.3485.54)
    Firefox: 144.0.2 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.7309
Used Package Manager

pnpm

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked vue-vapor-component reproduction and its Vitest configuration, then trace how VaporInteropPlugin handles the Vue SFC containing <script setup vapor lang="ts">. Compare the failing Vitest run with the same component without vapor; done means the vapor component executes successfully under Vitest without the defineVaporComponent error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.