@csedl/svelte-on-rails 12.0.1 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/svelte-ssr-server.js +1 -1
- package/package.json +1 -1
- package/src/ssr/render.js +1 -1
- package/src/utils.js +6 -2
package/bin/svelte-ssr-server.js
CHANGED
|
@@ -82,7 +82,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
82
82
|
logger(`body => «${request_body}»`);
|
|
83
83
|
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
84
84
|
res.end(JSON.stringify({
|
|
85
|
-
html: componentRenderError(basename, err),
|
|
85
|
+
html: componentRenderError(basename, err, true),
|
|
86
86
|
head: ''
|
|
87
87
|
}));
|
|
88
88
|
}
|
package/package.json
CHANGED
package/src/ssr/render.js
CHANGED
package/src/utils.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export function componentRenderError(component, error) {
|
|
1
|
+
export function componentRenderError(component, error, ssr = false) {
|
|
2
|
+
|
|
3
|
+
const hint = 'Check browser console for full details.'
|
|
4
|
+
const ssrHint = 'This is Server Side rendered. When Hydrated, you will see a more detailed error message.'
|
|
5
|
+
|
|
2
6
|
return (`
|
|
3
7
|
<div style="
|
|
4
8
|
padding: 1.5rem;
|
|
@@ -15,7 +19,7 @@ export function componentRenderError(component, error) {
|
|
|
15
19
|
${error.message || 'Unknown rendering error'}
|
|
16
20
|
</p>
|
|
17
21
|
<small style="color: #7f1d1d; opacity: 0.8;">
|
|
18
|
-
|
|
22
|
+
${ssr ? ssrHint : hint}
|
|
19
23
|
</small>
|
|
20
24
|
</div>
|
|
21
25
|
`)
|