I have an error when I want to use ‘prerender-spa-plugin’ in my quasar application.
App • WAIT • Compiling of "UI" in progress...
[prerender-spa-plugin] Unable to prerender all routes!
App • DONE • "UI" compiled with errors • 8092ms
App • ERROR • UI
[prerender-spa-plugin] Unable to prerender all routes!
App • COMPILATION FAILED • Please check the log above for details.
I added prerender-spa-plugin
in my package.js
"dependencies": {
"@quasar/extras": "^1.12.0",
"axios": "^0.24.0",
"core-js": "^3.19.1",
"html-webpack-plugin": "^5.5.0",
"quasar": "^2.3.1",
"vue-i18n": "^9.1.9",
"vuex": "^4.0.1"
},
"devDependencies": {
"@babel/eslint-parser": "^7.16.3",
"@quasar/app": "^3.2.1",
"@quasar/quasar-app-extension-qoverlay": "2.0.1",
"eslint": "^8.2.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.1.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-vue": "^7.0.0",
"eslint-webpack-plugin": "^3.1.1",
"prerender-spa-plugin": "^3.4.0"
},
I am trying to use it like this in the quasar.conf.js
I import it like this:
const path = require('path')
const PrerenderSPAPlugin = require('prerender-spa-plugin')
build: {
vueRouterMode: 'history', // available values: 'hash', 'history'
extendWebpack (cfg) {
cfg.plugins.push(
new PrerenderSPAPlugin({
staticDir: path.join(__dirname, 'dist/spa/'),
routes: ['/', '/page1']
})
)
},
...
}
Do you have any idea how to solve this problem?
I tried many things that I could find on google but without success.