Subscribe on changes!

render function made with compiler-core doesn't work, template works

avatar
Sep 29th 2020

Version

3.0.0

Reproduction link

https://codepen.io/rhengles/pen/vYGwGLr

Steps to reproduce

Compile a basic template with compiler-core:baseCompile which uses the <router-view> component, and pass to it the route object as a prop, or a computed value that uses the route object.

What is expected?

That I get the same output that I get from the template show below:

<div class="app--root">
    <router-view v-bind:route="routeWithModal"></router-view>
</div>

What is actually happening?

A warning is printed on the console:

test.html:81 [Vue warn]: Property undefined was accessed during render but is not defined on instance. 
  at <App>
warn	@	vue.global.js:1239
get	@	vue.global.js:7061
render	@	test.html:81

The test.html:81 line is shown below:

    const _Vue = Vue;
    return function render(_ctx, _cache) {
      with (_ctx) {
        const {
          createVNode: _createVNode,
          openBlock: _openBlock,
          createBlock: _createBlock
        } = _Vue;
        return (_openBlock(), _createBlock("div", {
          class: "app--root",
          ref: "refRoot"
        }, [
          _createVNode("router-view",
            { route: routeWithModal }, // <= error here
            null,
            8 /* PROPS */,
            ["route"]
          )
        ], 512 /* NEED_PATCH */))
      }
    };
avatar
Sep 30th 2020

I guess we're meant to use @vue/compiler-dom. We need documentation on this.