Subscribe on changes!

@vue/compiler-sfc TypeError: Cannot set property 'render' of undefined

avatar
Oct 1st 2020

Version

3.0.0

Reproduction link

https://codesandbox.io/s/xenodochial-surf-jcxcl

Steps to reproduce

npm run build

What is expected?

build suceess and no runtime error

What is actually happening?

js error,show TypeError: Cannot set property 'render' of undefined

  • win10

  • node v14.13.0

if comment src\views\home\index.vue

<!--script lang="ts">
import '@/fix-setup-sugar'
</script-->
<script setup lang="ts">
export { default as Contact } from '../Contact.vue';
</script>

the vue-cli-service build will show

 error  in ./src/views/home/index.vue?vue&type=script&setup=true&lang=ts

Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 1)
Cannot read property 'content' of null
    at PoolWorker.fromErrorObj (D:\Dev\template\jcxcl\node_modules\thread-loader\dist\WorkerPool.js:262:12)
    at D:\Dev\template\jcxcl\node_modules\thread-loader\dist\WorkerPool.js:204:29
    at mapSeries (D:\Dev\template\jcxcl\node_modules\neo-async\async.js:3625:14)
    at PoolWorker.onWorkerMessage (D:\Dev\template\jcxcl\node_modules\thread-loader\dist\WorkerPool.js:170:35)
    at D:\Dev\template\jcxcl\node_modules\thread-loader\dist\WorkerPool.js:152:14
    at Object.selectBlock (D:\Dev\template\jcxcl\node_modules\@vue\cli-service\node_modules\vue-loader-v16\dist\select.js:25:45)
    at Object.loader (D:\Dev\template\jcxcl\node_modules\@vue\cli-service\node_modules\vue-loader-v16\dist\index.js:59:25)

 @ ./src/views/home/index.vue?vue&type=script&setup=true&lang=ts 1:0-429 1:0-429 1:430-848 1:430-848
 @ ./src/views/home/index.vue
 @ ./src/router/index.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

Otherwise use this meaningless script,build can success done.but the page will show error:TypeError: Cannot set property 'render' of undefined

the file /js/home.6e14bc9a.js

(void 0).render