vue.jsvite

vite Internal server error: Codegen node is missing for element/if/for node. Apply appropriate transforms first


so yesterday i was working on a project and by the time i was about to quit because i was done with it i got this error and have been trying to fix it the entire day today. My code worked, then broke, undid everything to a point where i knew it worked, but it was still broken.

The error i get in my browserConsole is : GET http://localhost:8080/src/js/component/App.vue net::ERR_ABORTED 500 (Internal Server Error) (main.js:5)

when i look at main.js line 5 there is only an import for App. i have not touched main.js, App.vue and AppTemplate.vue since the beginning of the project sinse i did not have to.

To run my code i use run vite in the terminal (or in my case a shortcut for the run window in phpstorm) there i get another error:

Cannot read properties of undefined (reading 'type')
Cannot read properties of undefined (reading 'type') (x2)
Cannot read properties of undefined (reading 'type') (x3)
Cannot read properties of undefined (reading 'type') (x4)
Cannot read properties of undefined (reading 'type') (x5)
Cannot read properties of undefined (reading 'type') (x6)
Cannot read properties of undefined (reading 'type') (x7)
Cannot read properties of undefined (reading 'type') (x8)
Cannot read properties of undefined (reading 'type') (x9)
Cannot read properties of undefined (reading 'type') (x10)
1:40:13 PM [vite] Internal server error: Codegen node is missing for element/if/for node. Apply appropriate transforms first.
  Plugin: vite:vue
  File: /Users/robdewilligen/Development/Wittig/jobse/app/src/js/component/App.vue
      at assert (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:508:15)
      at genNode (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2628:13)
      at genNodeList (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2602:13)
      at genNodeListAsArray (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2587:5)
      at genNodeList (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2599:13)
      at genVNodeCall (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2770:5)
      at genNode (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2651:13)
      at generate (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2412:9)
      at Object.baseCompile (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:5690:12)
      at Object.compile (/Users/robdewilligen/Development/Wittig/jobse/app/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:3100:25) ```

this bit repeats another 6 or 7 times or so:
``` Cannot read properties of undefined (reading 'type')
Cannot read properties of undefined (reading 'type') (x2)
Cannot read properties of undefined (reading 'type') (x3)
Cannot read properties of undefined (reading 'type') (x4)
Cannot read properties of undefined (reading 'type') (x5)
Codegen node is missing for element/if/for node. Apply appropriate transforms first.
Codegen node is missing for element/if/for node. Apply appropriate transforms first. (x2)

So far i have tried anything i could find or think of,

beginning with restarting vite, restarting docker container, restarting my laptop, like i said before, revert to a working version but still broken. updating terminal dev tools and a few things git was complaining about. check for wrong placed tags. (none were wrongplaced)

i have no clue what to do anymore and any and all suggestions are very much welcome. Any info requested i will do my best to share soon.

I have a macbook pro 2020 use Vue 3 with Vite a few library's i use are: vue-class-components axios vue-router vueX


Solution

  • So i figured it out, well, my boss of design did, all i had to do was delete the node_modules directory and run npm install to reinstall the directory. this fixed it for me. hope it does for others to.