/
500.html
115 lines (102 loc) 路 3.34 KB
/
500.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>馃毃 Build Error</title>
<style>
html {
color-scheme: dark light;
background-color: #282c33;
}
body {
margin: 0;
font-family: sans-serif;
}
.title-heading {
font-size: 2rem;
background-color: #fe0140;
color: #ffffff;
margin: 0 0 20px 0;
padding: 10px;
}
.error-message {
font-size: 1.2rem;
color: salmon;
margin: 10px;
font-family: Menlo, Consolas, monospace;
white-space: pre;
}
.error-hints-container {
margin: 5px 0 20px 0;
list-style: none;
padding: 0;
}
.error-hints-container li:before {
content: '馃挕 ';
}
.error-hint {
color: #5e8af7;
font-size: 0.8rem;
padding: 0 0 0 5px;
font-family: Menlo, Consolas, monospace;
}
.error-stack-trace {
padding: 20px 10px;
background-color: #282c33;
color: #c5ccdb;
font-family: Menlo, Consolas, monospace;
font-size: 0.8rem;
white-space: pre;
}
.documentation {
padding: 0 5px;
font-family: Menlo, Consolas, monospace;
font-size: 0.8rem;
}
.documentation a {
color: violet;
}
</style>
</head>
<body>
<h1 class="title-heading">馃毃 Parcel encountered errors</h1>
<% errors.forEach(function(error){ %>
<h2 class="error-message"><%- error.message %></h2>
<div class="error-stack-trace"><% if (error.frames?.length) { %><% error.frames.forEach(function(frame){ %><a href="/__parcel_launch_editor?file=<%- encodeURIComponent(frame.location) %>" style="text-decoration: underline; color: #888" onclick="fetch(this.href); return false"><%- frame.location %></a>
<%- frame.code %><% }); %><% } else { %><%- error.stack %><% } %></div>
<ul class="error-hints-container">
<% error.hints.forEach(function(hint){ %>
<li class="error-hint"><%- hint %></li>
<% }); %>
</ul>
<% if (error.documentation) { %>
<div class="documentation">馃摑 <a href="<%- error.documentation %>" target="_blank">Learn more</a></div>
<% } %>
<% }); %>
<% if (hmrOptions) { %>
<script>
// Reload the page when an HMR update occurs.
var protocol =
(location.protocol == 'https:' &&
!/localhost|127.0.0.1|0.0.0.0/.test(hostname))
? 'wss'
: 'ws';
var hostname = <%- JSON.stringify(hmrOptions.host || null) %> || location.protocol.indexOf('http') === 0 ? location.hostname : 'localhost';
var port = <%- JSON.stringify(hmrOptions.port || null) %> || location.port;
var ws = new WebSocket(protocol + '://' + hostname + (port ? ':' + port : '') + '/');
var receivedInitialMessage = false;
ws.onmessage = (e) => {
let data = JSON.parse(e.data);
// The HMR server sends the pending error immediately on connect. Ignore this.
if (data.type == 'error' && !receivedInitialMessage) {
receivedInitialMessage = true;
return;
}
location.reload();
};
</script>
<% } %>
</body>
</html>