vue-vega icon indicating copy to clipboard operation
vue-vega copied to clipboard

[Vue warn]: You are using the runtime-only build of Vue

Open peteruithoven opened this issue 5 years ago • 4 comments
trafficstars

I've started a new project using the Vue cli, but when I install vue-vega and add a simple example I get this error:

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

Is there anything I can do? Maybe some additional Getting started step would be good?

I'd love to combine vue-vega with VuePress where you normally compile as much as possible beforehand.

peteruithoven avatar Apr 03 '20 12:04 peteruithoven

This might be related to: https://github.com/nesterone/vue-vega/issues/33 ?

peteruithoven avatar Apr 03 '20 12:04 peteruithoven

// HelloWorld.vue
<template>
  <vega-lite :data="values" mark="bar" :encoding="encoding" />
</template>

<script>
import Vue from "vue";
import VueVega from "vue-vega";

Vue.use(VueVega);

export default {
  name: "HelloWorld",
  props: {
    msg: String
  },
  data() {
    return {
      values: [
        { a: "A", b: 28 },
        { a: "B", b: 55 },
        { a: "C", b: 43 },
        { a: "D", b: 91 },
        { a: "E", b: 81 },
        { a: "F", b: 53 },
        { a: "G", b: 19 },
        { a: "H", b: 87 },
        { a: "I", b: 52 }
      ],
      encoding: {
        x: { field: "a", type: "ordinal" },
        y: { field: "b", type: "quantitative" }
      }
    };
  }
};
</script>

peteruithoven avatar Apr 03 '20 12:04 peteruithoven

Including the compiler of course fixes it

// vue.config.js
module.exports = {
  runtimeCompiler: true
};

Reference: https://cli.vuejs.org/config/#runtimecompiler More info: https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only

How to do this for VuePress: https://github.com/vuejs/vuepress/issues/402#issuecomment-388169056

peteruithoven avatar Apr 03 '20 13:04 peteruithoven

Is this an issue with how vue-vega is packaged? Is there a way to update this library to avoid needing to add this to projects using this lib?

bschimoler avatar Jun 18 '21 14:06 bschimoler