I am trying to compile my vue component to unit test it.
I added the import { render } from "@vue/server-test-utils"; line at the beginning of my test file. I also run the command npm i --save-dev @vue/server-test-utils which completed successfully. I checked the node_modules folder that the dependency was indeed installed.
But still when I run the test file I am getting the error:
WEBPACK Failed to compile with 1 error(s) Error in ./node_modules/@vue/server-test-utils/dist/vue-server-test-utils.js Module not found: 'vue-server-renderer'
Here I found a similar issue. I tried adding the
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.tap(options => {
options.isServerBuild = false;
return options;
});
}
to my webpack config, but it did not help.
I am using Vue 2. Maybe someone happened to stumble across this issue and knows a solution?
