Skip to content

Commit 34c70ca

Browse files
committed
fix for issue with error view in production builds
1 parent cab2c51 commit 34c70ca

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

pkg/middleware/recovery.go

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func Recovery() macaron.Handler {
115115

116116
c.Data["Title"] = "Server Error"
117117
c.Data["AppSubUrl"] = setting.AppSubUrl
118+
c.Data["Theme"] = setting.DefaultTheme
118119

119120
if setting.Env == setting.DEV {
120121
if theErr, ok := err.(error); ok {

scripts/webpack/webpack.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = merge(common, {
8585
new HtmlWebpackPlugin({
8686
filename: path.resolve(__dirname, '../../public/views/error.html'),
8787
template: path.resolve(__dirname, '../../public/views/error-template.html'),
88-
inject: 'false',
88+
inject: false,
8989
}),
9090
new HtmlWebpackPlugin({
9191
filename: path.resolve(__dirname, '../../public/views/index.html'),

scripts/webpack/webpack.prod.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ module.exports = merge(common, {
7474
filename: "grafana.[name].[hash].css"
7575
}),
7676
new ngAnnotatePlugin(),
77+
new HtmlWebpackPlugin({
78+
filename: path.resolve(__dirname, '../../public/views/error.html'),
79+
template: path.resolve(__dirname, '../../public/views/error-template.html'),
80+
inject: false,
81+
}),
7782
new HtmlWebpackPlugin({
7883
filename: path.resolve(__dirname, '../../public/views/index.html'),
7984
template: path.resolve(__dirname, '../../public/views/index-template.html'),
8085
inject: 'body',
8186
chunks: ['vendor', 'app'],
8287
}),
83-
new HtmlWebpackPlugin({
84-
filename: path.resolve(__dirname, '../../public/views/error.html'),
85-
template: path.resolve(__dirname, '../../public/views/error-template.html'),
86-
inject: false,
87-
}),
8888
function () {
8989
this.hooks.done.tap('Done', function (stats) {
9090
if (stats.compilation.errors && stats.compilation.errors.length) {

0 commit comments

Comments
 (0)