Marko: Lasso-express example doesn't support async/await

Created on 18 Feb 2021  Â·  5Comments  Â·  Source: marko-js/marko

Marko Version: ^5.0.0

├─┬ [email protected]
│ └── [email protected] 
└── [email protected] 

Details

Create lasso-express example app:

npx @marko/create

Select lasso-express on selector.

Open server.js and add a new middleware with async.

Expected Behavior

Should works normally

Actual Behavior

Throws an babel error about generators

Possible Fix

I try to add node12 as preset on babel config file, but then throw a new error. :-/

Also, is lasso best option to SSR? Webpack example works correctly.

unverified bug

All 5 comments

https://github.com/marko-js/examples/blob/master/examples/lasso-express/babel.config.js#L2

Should probably change to:

  presets: [["@babel/preset-env", { targets: { node: "current" } }]]

Could you test that out?

I'll also add that we are currently recommended using our webpack setup for new apps (see https://github.com/marko-js/examples/tree/master/examples/webpack-express) or npx @marko/create --template webpack-express

@DylanPiercey with your change it works. Thank you. I will try webpack version with more detail :)

Awesome :). I'll update the lasso examples accordingly.

Fixed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grawlinson picture grawlinson  Â·  4Comments

jdnichollsc picture jdnichollsc  Â·  5Comments

JarvisPrestidge picture JarvisPrestidge  Â·  4Comments

andersea picture andersea  Â·  4Comments

gunjam picture gunjam  Â·  6Comments