{"id":26617,"library":"vue-native-template-compiler","title":"Vue Native Template Compiler","description":"Vue Native template compiler, part of the Vue Native ecosystem that enables Vue.js developers to build native mobile apps using React Native under the hood. The current stable version is 0.3.1, released in 2020. It compiles Vue templates into React Native components at build time. Key differentiators: it allows using Vue syntax (v-if, v-for, etc.) on React Native, and is the core compiler for vue-native-scripts. Alternatives include React Native itself or using Vue with a WebView approach. This package is auto-generated from the vue-native-core monorepo.","status":"maintenance","version":"0.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/GeekyAnts/vue-native-core","tags":["javascript","react","vue","template","compiler"],"install":[{"cmd":"npm install vue-native-template-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add vue-native-template-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue-native-template-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Compiles Vue templates; depends on Vue's compiler internals","package":"vue","optional":false}],"imports":[{"note":"The package exports a single default function. CommonJS require works in Node.js, but ESM import is preferred for bundlers.","wrong":"const compiler = require('vue-native-template-compiler')","symbol":"compiler","correct":"import compiler from 'vue-native-template-compiler'"},{"note":"The compile function is not exported by vue-native-template-compiler; it is provided by vue-template-compiler. Users often mistakenly try to import compile from this package.","wrong":"import { compile } from 'vue-native-template-compiler'","symbol":"compile","correct":"import { compile } from 'vue-template-compiler'"},{"note":"Similarly, parseComponent is from vue-template-compiler, not this package.","wrong":"import { parseComponent } from 'vue-native-template-compiler'","symbol":"parseComponent","correct":"import { parseComponent } from 'vue-template-compiler'"}],"quickstart":{"code":"// This package is typically used internally by vue-native-scripts.\n// To use directly:\nconst compiler = require('vue-native-template-compiler');\nconst template = '<template><View><Text>Hello</Text></View></template>';\nconst result = compiler(template);\nconsole.log(result); // returns compiled React Native code\n","lang":"javascript","description":"Shows how to use the default compiler export to convert a Vue template string into React Native components."},"warnings":[{"fix":"Manually import these components from 'react-native' and register them as Vue components.","message":"Deprecated React Native components (CheckBox, Clipboard, ImageStore, MaskedViewIOS) removed in v0.2.0 and v0.1.0. These components are no longer usable from .vue files unless manually imported.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Evaluate if Vue Native is still suitable for new projects; consider migrating to React Native or other frameworks.","message":"Package is auto-generated and not actively maintained. Last release v0.3.1 (2020). Consider using React Native directly or alternative solutions.","severity":"deprecated","affected_versions":"all"},{"fix":"Ensure vue@2.2.6 is installed as a dependency.","message":"Requires peer dependency on specific Vue version (2.2.6). Using a different Vue version may cause compilation errors.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Upgrade to v0.1.3 or later.","message":"Memory leak fixed in v0.1.3. Earlier versions could cause memory overflow due to uncontrolled growth.","severity":"gotcha","affected_versions":"<0.1.3"}],"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-native-template-compiler' or add it to package.json.","cause":"The package is not installed or missing from node_modules.","error":"Error: Cannot find module 'vue-native-template-compiler'"},{"fix":"Use Node.js 14+ or set 'type': 'module' correctly.","cause":"Export map issue in older Node.js versions (not directly related to this package but occurs with ESM).","error":"Error: Default condition should be last one"},{"fix":"Use 'import compiler from \"vue-native-template-compiler\"' or 'const compiler = require(\"vue-native-template-compiler\")'.","cause":"Wrong import pattern: using named import instead of default import.","error":"TypeError: compiler is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}