Configuration 404 page
In the configuration module of the application, customize the content displayed when the page fails to load by setting the fail
function.
In this example, the first line of the error message that displays when the page fails to load will be shown;
export const fail = ({ src, error }) => {
return `<div style="width:100%;height:100%;display:flex;justify-content:center;align-items:center;word-break:break-all;" data-testid="error-container">
<div style="padding:20px;text-align:center;">
<h3>load fail</h3>
<p>${error.stack.split(/\n/g)[0]}</p>
${src}
<div>
<button on:click="back()">Back</button>
</div>
</div>
</div>`;
};