{"id":26630,"library":"wallaby-vue-compiler","title":"Wallaby Vue Compiler","description":"Wallaby.js compiler for Vue single-file components enabling code coverage display. v1.0.6 stable, low update frequency. Requires vue-template-compiler as peer dep and accepts a separate compiler (e.g., Babel) for script section compilation. Different from other Vue compilers by integrating directly with Wallaby's coverage instrumentation pipeline.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install wallaby-vue-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add wallaby-vue-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add wallaby-vue-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Compiles Vue template strings from .vue files; required as peer dependency.","package":"vue-template-compiler","optional":false}],"imports":[{"note":"The module exports a function that must be invoked with a compiler argument immediately. ESM import will not work due to its CommonJS nature.","wrong":"import compiler from 'wallaby-vue-compiler';","symbol":"default","correct":"const compiler = require('wallaby-vue-compiler')(wallaby.compilers.babel({}));"},{"note":"No named exports exist; destructuring will result in undefined.","wrong":"const { wallabyVueCompiler } = require('wallaby-vue-compiler');","symbol":"default (module.exports)","correct":"const wallabyVueCompiler = require('wallaby-vue-compiler');"},{"note":"The package is CommonJS only. ESM import may fail in some environments; use require() or dynamic import.","wrong":"","symbol":"default (ESM attempt)","correct":"import wallabyVueCompiler from 'wallaby-vue-compiler';"}],"quickstart":{"code":"// wallaby.js\nmodule.exports = function (wallaby) {\n  return {\n    files: ['src/**/*.vue', 'src/**/*.js'],\n    tests: ['test/**/*.spec.js'],\n    compilers: {\n      '**/*.js': wallaby.compilers.babel({}),\n      '**/*.vue': require('wallaby-vue-compiler')(wallaby.compilers.babel({}))\n    },\n    env: {\n      type: 'node'\n    }\n  };\n};","lang":"javascript","description":"Configures Wallaby.js to compile .vue files with the Vue compiler, using Babel for script sections."},"warnings":[{"fix":"Consider using @vue/compiler-sfc for Vue 3 or Vue 2.7+ projects.","message":"Package relies on vue-template-compiler which is deprecated since Vue 2.7.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always call require('wallaby-vue-compiler')(scriptCompiler) in the compilers config.","message":"The compiler must be invoked immediately with a script compiler argument; forgetting this will cause a runtime error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Invoke the default export as a factory: const vueCompiler = require('wallaby-vue-compiler')(wallaby.compilers.babel({}));","message":"The module exports a function, not a class or object; using it as a normal compiler will fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For Vue 3 projects, use a different coverage tool or Wallaby's native Vue 3 support.","message":"Only works with Vue 2 due to vue-template-compiler peer dependency.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install vue-template-compiler@^2.6.10 --save-dev","cause":"Missing peer dependency vue-template-compiler.","error":"Error: Cannot find module 'vue-template-compiler'"},{"fix":"Use require('wallaby-vue-compiler')(wallaby.compilers.babel({})) instead of just require('wallaby-vue-compiler')","cause":"Importing the module but forgetting to call it as a function with a compiler argument.","error":"TypeError: wallabyVueCompiler is not a function"},{"fix":"Pass wallaby.compilers.something({}) as the first argument.","cause":"The argument passed to the factory is not a valid Wallaby compiler object.","error":"Error: Compiler is not set or is not a valid Wallaby compiler"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}