If only an empty script tag is written in the vue single file component, the development environment will not report an error, but it will report an error as soon as it is packaged.

<template>
    <div>
        

</div> </template> <script> </script>

if the above code, as a simple component, is referenced in other components, the compilation of the development environment will not report an error, but as soon as it is packaged, it will report that Cannot set property render of undefined", will not report an error if it does not write this script empty tag, or it may be written with export default {} . Why, considering that the component is not exposed, why does the development environment not report an error? ask for divine guidance

.
Apr.06,2022

this is a bug of vue-loader.


also encounters the same problem. An empty script tag will cause the generated options object to be empty when vue-loader parses the component, causing the render function to fail to render

Menu