created: 2020-04-14T03:15:24.000Z

runtime-only build of Vue where the template compiler is not available

vueコンポーネントが混ざったjsのテストで以下のようなwarningがでる

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build

これは、単一ファイルコンポーネントではないVueコンポーネント( runtime-only build )をランタイムでコンパイルなしに使おうとしていて咎められているようだ

templateをコンパイル済みのjsコードを用意するか、compiler-included build のvueを使うかが逃げ道として提示されている

compiler-included build のvueを使うほうが楽そうだ。jestでテストを走らせているので、そのランタイムでcompiler-included build のvueが使われるようにする

具体的には jest.config.js にて moduleNameMapper に以下の設定を入れる

// commonjsのプロジェクトなので `vue.common.dev.js`
moduleNameMapper = {'^vue$': 'vue/dist/vue.common.dev.js'}

参考

詳説 データベース ―ストレージエンジンと分散データシステムの仕組み
[ad] 詳説 データベース ―ストレージエンジンと分散データシステムの仕組み
Alex Petrov, 小林 隆浩 (単行本(ソフトカバー))