Subscribe on changes!

Error "Cannot read property 'el' of undefined" in production mode

avatar
Sep 23rd 2020

Version

3.0.0

Reproduction link

https://github.com/chenhaihong/vue-next-runtime-core-error

Steps to reproduce

  1. Use @vue/cli to create a new project.
  2. Put the code into your page's template
<pre>
      <!-- <code class="javascript" v-hljs>const a = 100;</code> -->
      <code class="javascript">const a = 100;</code>
</pre>
  1. run yarn build
  2. run http-server ./dist
  3. visit the page
  4. error happens now.

What is expected?

It should wokr with the same as

<pre>
      <code class="javascript">const a = 100;</code>
</pre>

What is actually happening?

runtime-core.esm-bundler.js?5c40:2020 Uncaught TypeError: Cannot read property 'el' of undefined at cloneIfMounted (runtime-core.esm-bundler.js?5c40:2020) at mountChildren (runtime-core.esm-bundler.js?5c40:4178) at mountElement (runtime-core.esm-bundler.js?5c40:4103) at processElement (runtime-core.esm-bundler.js?5c40:4075) at patch (runtime-core.esm-bundler.js?5c40:3988) at mountChildren (runtime-core.esm-bundler.js?5c40:4180) at mountElement (runtime-core.esm-bundler.js?5c40:4103) at processElement (runtime-core.esm-bundler.js?5c40:4075) at patch (runtime-core.esm-bundler.js?5c40:3988) at componentEffect (runtime-core.esm-bundler.js?5c40:4493)