diff --git a/packages/marko-core/components/resolve.marko b/packages/marko-core/components/resolve.marko index 1fb9d93e4..56e4d9d24 100644 --- a/packages/marko-core/components/resolve.marko +++ b/packages/marko-core/components/resolve.marko @@ -13,7 +13,7 @@ $ const { isArray } = Array; <${input.onError} err=err /> -
An unexpected error occurred: ${err.message}
+
An unexpected error occurred: ${err.message}
${err.stack}
$ console.error(err); diff --git a/packages/marko-web/components/document/components/error.marko b/packages/marko-web/components/document/components/error.marko index 8fe754838..bcbc35214 100644 --- a/packages/marko-web/components/document/components/error.marko +++ b/packages/marko-web/components/document/components/error.marko @@ -14,7 +14,7 @@ $ const error = input.error || {}; <@page for="error"> <@section> -

${input.statusCode} ${input.statusMessage}

+

${input.statusCode} ${input.statusMessage}

${error.message}

${error.stack}
diff --git a/packages/marko-web/integration/test-website-boot.js b/packages/marko-web/integration/test-website-boot.js new file mode 100644 index 000000000..d31437701 --- /dev/null +++ b/packages/marko-web/integration/test-website-boot.js @@ -0,0 +1,31 @@ +const fetch = require('node-fetch'); + +const { error, log } = console; + +setInterval(async () => { + try { + const res = await fetch('http://localhost:80', { method: 'get' }); + if (!res.ok) { + error('Response not ok!', res.status, res.statusText); + process.exit(1); + } else { + const html = await res.text(); + const found = /.*<\/head>.*<\/body>.*<\/html>.*/is.test(html); + if (!found) { + error('Unable to find closing HTML tags!'); + process.exit(1); + return; + } + // now check for any server errors + if (/data-marko-error="true"/g.test(html)) { + error('An in-page server-side Marko error was encountered!'); + process.exit(1); + return; + } + log('Integration tests passed!'); + process.exit(0); + } + } catch (e) { + // noop + } +}, 100); diff --git a/packages/marko-web/package.json b/packages/marko-web/package.json index 338ba9c47..7521da55f 100644 --- a/packages/marko-web/package.json +++ b/packages/marko-web/package.json @@ -47,6 +47,7 @@ "http-errors": "^1.8.1", "jquery": "^3.6.3", "marko": "~4.20.0", + "node-fetch": "^2.6.9", "vue": "^2.7.14", "vue-server-renderer": "^2.7.14" },