Closed maximilianschmitt closed 7 years ago
Hi!
I'm using Lasso 2.11.7, Marko 4.2.0 and lasso/middleware to serve my example app with express. I'm getting the following HTML rendered if I view-source:
Lasso 2.11.7
Marko 4.2.0
lasso/middleware
<!doctype html><html><head><title Renderer></title></head><body><div>Hello world</div><div><img src="/static/icon-edit-557d230d.svg">
(scroll to see that it's incomplete)
The svg is being pulled in with lasso-img. I'm expecting something like this:
lasso-img
<!doctype html><html><head><title Renderer></title></head><body><div>Hello world</div><div><img src="/static/icon-edit-557d230d.svg"></div></body></html>
If I restart the server it will render correctly the first time I hit the page. All subsequent requests are served incomplete HTML.
The code I'm using for express:
'use strict' require('marko/node-require') // allow requiring templates var express = require('express') var app = express() app.get('/', function (req, res, next) { require('./index.marko').render({}, res) }) app.use(require('lasso/middleware').serveStatic()) app.listen(8001, function () { console.log('Listening on port 8001') }) require('lasso').configure({ plugins: [ 'lasso-marko' ], outputDir: __dirname + '/static' })
I also put this in an example repository: https://github.com/maximilianschmitt/lasso-test
/cc @mlrawlings
Thanks for the report! Fixed via https://github.com/lasso-js/lasso/commit/b81bc848ccfc3ba49abffca2199410b75322d094. lasso@2.11.8 published.
lasso@2.11.8
Nice, thanks for the quick fix! :)
Hi!
I'm using
Lasso 2.11.7
,Marko 4.2.0
andlasso/middleware
to serve my example app with express. I'm getting the following HTML rendered if I view-source:(scroll to see that it's incomplete)
The svg is being pulled in with
lasso-img
. I'm expecting something like this:If I restart the server it will render correctly the first time I hit the page. All subsequent requests are served incomplete HTML.
The code I'm using for express:
I also put this in an example repository: https://github.com/maximilianschmitt/lasso-test