{"id":12600,"library":"vue-template-validator","title":"Vue Template Validator","description":"Vue Template Validator is an archival utility designed to catch common syntax errors in Vue.js templates at compile time. It operates by analyzing template strings to identify malformed syntax. The package's last update was over 10 years ago, with its most recent official version being 1.1.5. Due to its age and lack of maintenance, it is not compatible with modern Vue.js versions (Vue 2.x, Vue 3.x, or the Composition API) and is largely superseded by contemporary build tools and linters like ESLint with `eslint-plugin-vue`. Its release cadence was sporadic and has ceased entirely. Key differentiators at the time of its development were its focus on compile-time template syntax validation, distinct from runtime form validation libraries.","status":"abandoned","version":"1.1.5","language":"javascript","source_language":"en","source_url":"https://github.com/vuejs/vue-template-validator","tags":["javascript","vue"],"install":[{"cmd":"npm install vue-template-validator","lang":"bash","label":"npm"},{"cmd":"yarn add vue-template-validator","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue-template-validator","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for HTML parsing to analyze Vue templates, though the peer dependency version is outdated.","package":"parse5","optional":false}],"imports":[{"note":"This package is CommonJS-only and does not support ESM imports. Using 'import' will result in an error.","wrong":"import validate from 'vue-template-validator'","symbol":"validate","correct":"const validate = require('vue-template-validator')"}],"quickstart":{"code":"const validate = require('vue-template-validator');\n\nconst templateString = `<template>\n  <div v-if=\"isValid\">\n    <p>Hello World</p>\n    <img src=\"image.jpg\" />\n  </div>\n  <div v-else></div>\n</template>\n\n<style>\n.container {\n  color: blue;\n}\n</style>\n\n<script>\nexport default {\n  data() {\n    return {\n      isValid: true\n    };\n  }\n};\n</script>`;\n\nconst warnings = validate(templateString);\n\nif (warnings.length > 0) {\n  console.error('Template validation errors found:');\n  warnings.forEach(function (msg) {\n    console.error(`- ${msg}`);\n  });\n} else {\n  console.log('Template is valid!');\n}","lang":"javascript","description":"Demonstrates how to import the `validate` function and use it to check a Vue template string for syntax errors, logging any warnings found."},"warnings":[{"fix":"For modern Vue.js applications, use official Vue tooling for template linting, such as ESLint with `eslint-plugin-vue`.","message":"This package is not compatible with Vue 2.x, Vue 3.x, or modern Vue tooling (e.g., Vue CLI, Vite, Composition API). It was developed for older versions of Vue.js and relies on outdated internal structures.","severity":"breaking","affected_versions":">=1.1.6"},{"fix":"Avoid using this package in new projects. For existing legacy projects, understand the risks of using unmaintained software.","message":"The package is abandoned and has not been updated in over 10 years. This means there will be no bug fixes, security updates, or compatibility improvements for newer Node.js versions or JavaScript language features.","severity":"gotcha","affected_versions":">=1.1.5"},{"fix":"Migrate to `eslint-plugin-vue` for comprehensive template linting and validation in modern Vue applications.","message":"The functionality provided by `vue-template-validator` for basic template syntax checking is now integrated into or superseded by more robust and actively maintained linting tools like `eslint-plugin-vue`.","severity":"gotcha","affected_versions":">=1.1.5"},{"fix":"No direct fix is available for this package. It's an indicator of its abandonment and incompatibility with modern dependency ecosystems.","message":"The package uses `parse5` as a peer dependency with an old version constraint (`^2.1.0`). This might lead to compatibility issues or vulnerabilities with newer `parse5` versions or other dependencies in your project.","severity":"gotcha","affected_versions":">=1.1.5"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure you are using `const validate = require('vue-template-validator')` for CommonJS environments, as this package does not support ESM.","cause":"Attempting to use `validate` after an incorrect import, often when using `import` syntax in an ESM project with a CJS-only package.","error":"TypeError: validate is not a function"},{"fix":"Run `npm install vue-template-validator` to ensure the package is installed. Verify your module resolution settings if using a custom build setup.","cause":"The package is not installed or the module resolution path is incorrect in your environment.","error":"Cannot find module 'vue-template-validator'"},{"fix":"Install the correct version of `parse5` that matches the peer dependency requirement (e.g., `npm install parse5@^2.1.0`). However, consider the overall abandonment status of `vue-template-validator`.","cause":"The peer dependency `parse5` is missing or an incompatible version is installed.","error":"Error: Cannot find module 'parse5' (or similar error related to parse5)"}],"ecosystem":"npm"}