vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.82k stars 8.35k forks source link

After vue update, vue-tsc generates: "TypeError: (0 , language_core_1.buildMappings) is not a function" #11196

Closed crystalfp closed 5 months ago

crystalfp commented 5 months ago

Vue version

3.4.30

Link to minimal reproduction

none

Steps to reproduce

Go to any Vue + Vite project and do npx vue-tsc

What is expected?

Before the vue update from 3.4.29 to 3.4.30 vue-tsc gave no error

What is actually happening?

$ npx vue-tsc
TypeError: (0 , language_core_1.buildMappings) is not a function
    at D:\Projects\STMng\node_modules\@vue\language-core\lib\virtualFile\computedFiles.js:152:64
    at Array.map (<anonymous>)
    at D:\Projects\STMng\node_modules\@vue\language-core\lib\virtualFile\computedFiles.js:150:24
    at D:\Projects\STMng\node_modules\computeds\out\computed.js:13:68
    at Tracker.track (D:\Projects\STMng\node_modules\computeds\out\tracker.js:43:20)
    at fn (D:\Projects\STMng\node_modules\computeds\out\computed.js:13:56)
    at D:\Projects\STMng\node_modules\@vue\language-core\lib\virtualFile\computedFiles.js:28:79
    at Array.map (<anonymous>)
    at D:\Projects\STMng\node_modules\@vue\language-core\lib\virtualFile\computedFiles.js:28:70
    at D:\Projects\STMng\node_modules\computeds\out\computed.js:13:68

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 14.29 GB / 31.77 GB
  Binaries:
    Node: 21.6.2 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 126.0.6478.63
    Edge: Chromium (126.0.2592.68)
    Internet Explorer: 11.0.22621.3527

Any additional comments?

The issue has been opened also against vue-tsc, but its version has not been updated

mr-boost commented 5 months ago

Yes, I am facing the same issue even when scaffolding a new project with create-vue

yyx990803 commented 5 months ago

Likely related to #11150 /cc @KermanX @johnsoncodehk

KermanX commented 5 months ago

I think this will happen if running @vue/language-core<=2.0.21 with @volar/source-map>=2.3.1 (not related to vue's version). Upgrading vue-tsc to the latest v2.0.22 seems to work fine.

mr-boost commented 5 months ago

Problem seems solved when updating vue from 3.4.29 to 3.4.30 and vue-tsc from 2.0.21 to 2.0.22

crystalfp commented 5 months ago

Solved with vue-tsc 2.0.22 Thanks a lot!