Subscribe on changes!

[@vue/compiler-sfc ] shared.isKnownSvgAttr is not a function

avatar
Sep 14th 2021

Version

3.2.11

Reproduction link

codesandbox.io

1

Steps to reproduce

In my project, I use Vite. But on the codesandbox, It use Vue-CLI, produced the same error.

  1. Update These package to v3.2.11:
yarn add vue@3.2.11
yarn add -D @vue/compiler-sfc@3.2.11
  1. Start the local server
yarn dev

Ok, I will throw the error on the Terminal:

[vite] Internal server error: shared.isKnownSvgAttr is not a function
      at isStringifiableAttr (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:2862:22)
      at walk (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:2900:18)
      at analyzeNode (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:2927:12)
      at Object.stringifyStatic [as transformHoist] (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:2831:28)
      at walk (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1725:17)
      at walk (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1708:13)
      at hoistStatic (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1624:5)
      at transform (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2082:9)
      at Object.baseCompile (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:5630:5)
      at Object.compile (E:\Project\vue-3.2.11-demo\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:3045:25)

What is expected?

Compile normally

What is actually happening?

Compile Error


This didn’t happen to me in the previous version 3.2.8, until I updated the latest Vue version 3.2.11 today.

avatar
Sep 14th 2021

Yeah, just like when you call an IT engineer to repair your computer, he asks you to restart it first. I deleted the node_modules folder, and then reinstalled all the dependencies, and it was fine.