Cannot set properties of undefined (setting'render').
See original GitHub issueHello, I encountered a problem when using Vue-cli to package into the production environment: Cannot set properties of undefined (setting’render’).
The following are my few file configurations:
package.json
{
"name": "vue-cli",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-tsc --noEmit && vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@vue/composition-api": "^1.2.4",
"core-js": "^3.16.4",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.13",
"@vue/cli-plugin-typescript": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"typescript": "^4.4.2",
"unplugin-vue2-script-setup": "workspace:*",
"vue-template-compiler": "^2.6.14",
"vue-tsc": "^0.3.0"
}
}
vue.config.js
/* eslint-disable @typescript-eslint/no-var-requires */
const ScriptSetup = require('unplugin-vue2-script-setup/webpack')
/**
* @type {import('@vue/cli-service').ProjectOptions}
*/
module.exports = {
configureWebpack: {
plugins: [
ScriptSetup({
refTransform: true,
}),
],
},
chainWebpack(config) {
// disable type check and let `vue-tsc` handles it
config.plugins.delete('fork-ts-checker')
// disable cache for testing, you should remove this in production
config.module.rule('vue').uses.delete('cache-loader')
config.module.rule('js').uses.delete('cache-loader')
config.module.rule('ts').uses.delete('cache-loader')
config.module.rule('tsx').uses.delete('cache-loader')
},
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot Set Property 'Render' of Undefined
I fixed up my code and received this error: Error in render: "TypeError: Cannot read property 'toLowerCase' of undefined". But as for the...
Read more >Solution to Vue.js TypeError: Cannot set property 'render' of ...
Turns out I accidentally removed the export from my App.vue file. To solve, open your App.vue file and make sure App is being...
Read more >Uncaught TypeError: Cannot set property 'render' of undefined
My App.vue does have a default export. So do all other .vue files. <script lang="ts"> import Vue from 'vue'; import { Component, Prop...
Read more >[Solved]-why i get, Cannot set property of undefined-Vue.js
Just change this part: this.$axios.$get('mydomain.com' + customerId).then(function (data) { this.formFields = data.customers[0] }). To this: this.$axios.
Read more >vue typeerror: cannot set properties of undefined - You.com
Feb 11, 2019 ... Solution to Vue.js TypeError: Cannot set property 'render' of undefined ... Turns out I accidentally removed the export from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This plugin is conflicting with
thread-loader
for some reason, the current workaround is passingparallel: false
in yourvue.config.js
@antfu First of all, I am really sorry for not providing a detailed example.
The following is my system information:
I have provided a link to the project, hoping to find the problem.
https://github.com/maomincoding/vue2-cli-script-setup
I found the problem like this:
1. First I run the command
2. Startup project
There is no problem in the development environment.
3. Deploy to production environment
At this time, I found this error in the production environment.
The above is the problem I encountered, thanks.