Closed luozhihua closed 4 years ago
I have solved it, just delete the htmlWebpackPlugin
variable reference in src/index.template.html
;
my solution: modify src/index.template.html
from:
<!DOCTYPE html>
<html>
<head>
<title><%= htmlWebpackPlugin.options.productName %></title>
<meta charset="utf-8">
<meta name="description" content="<%= htmlWebpackPlugin.options.productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
...
to:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
...
This works for me because I can use quasar meta plugin
to manage page titles and descriptions, but it is still a big problem for people who depend on htmlWebpackPlugin
.
It was one step in the upgrade docs.
@pdanpdan do you have any idea how to solve this issue in the end? It happens when I want to use interpolation <%
.
I got it, htmlVariables now changed to:
htmlVariables: {
ctx: {
dev: true,
prod: false,
mode: [Object],
modeName: 'ssr',
target: {},
targetName: undefined,
emulator: undefined,
arch: {},
archName: undefined,
bundler: {},
bundlerName: undefined,
debug: false,
publish: undefined,
vueDevtools: false
},
process: { env: [Object] },
productName: '',
productDescription: ''
}
Means instead of htmlWebpackPlugin.options.ctx.mode.capacitor
and similar, you have to remove prefix htmlWebpackPlugin.options.
, so in the end it should be ctx.mode.capacitor
.
Yes, it's in the upgrade guide.
Just for the others: https://quasar.dev/quasar-cli/app-upgrade-guide
I have read the upgrade guide and removed all references to htmlWebpackPlugin.options.
within the template file.
Running yarn dev -m ssr
gives UnhandledPromiseRejectionWarning: ReferenceError: productName is not defined
index.template.html
<!DOCTYPE html>
<html>
<head>
<title><%= productName %></title>
<meta charset="utf-8">
<meta name="description" content="<%= productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<link rel="icon" type="image/png" sizes="128x128" href="favicon-128x128.png">
<link rel="icon" type="image/png" sizes="96x96" href="favicon-96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="icon" type="image/ico" href="favicon.ico">
</head>
<body>
<!-- DO NOT touch the following DIV -->
<div id="q-app"></div>
</body>
</html>
Edit:
I also have never configured webpack-html-plugin
or copy-webpack-plugin
Edit Again:
I skipped the step where I acutally install v2.0 🤦🏻♂️ It's been a long day
Describe the bug As title
Codepen/jsFiddle/Codesandbox (required) no
To Reproduce Steps to reproduce the behavior:
npm install @quasar/app@latest
quasar dev -m ssr
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Platform (please complete the following information):
Additional context Add any other context about the problem here.