We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
This is probably an issue with misunderstanding how koa/koa-hbs work, but it may be useful for others when they have the same problem while learning.
TL;DR: instead of rendering my template, I get a 404 even though my route executes, see https://github.com/01binary/shopper/tree/HandlebarsInitial for a snapshot.
yarn build
hbs.middleware({ viewPath: path.resolve(__dirname, '../../dist'), extname: '.html' })
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>App</title> </head> <body> <div id="app"> {{mount}} </div> <script type="text/javascript" src="scripts/vendor.js?83f7fa2dc8d8f8322d36"></script><script type="text/javascript" src="scripts/app.js?83f7fa2dc8d8f8322d36"></script></body> </html>
route.get('/', async(context) => { console.log('about to render layout') await context.render('layout', { mount: render() }); })
When I navigate to my app, I see "about to render layout" logged out, but then it gets a 404:
<-- GET / about to render layout --> GET / 404 9,964ms -
Why doesn't the hbs middleare render? Does it send a 404 or does koa send a 404? I can't understand what's happening and how to debug it.
Thank you!
The text was updated successfully, but these errors were encountered:
OK, inattentive readme reading on my part. I switched to using "next" version of koa-hbs:
readme
"dependencies": { "koa": "^2.3.0", "koa-hbs": "next", },
Sorry, something went wrong.
😄
No branches or pull requests
Hello,
This is probably an issue with misunderstanding how koa/koa-hbs work, but it may be useful for others when they have the same problem while learning.
TL;DR: instead of rendering my template, I get a 404 even though my route executes, see https://github.com/01binary/shopper/tree/HandlebarsInitial for a snapshot.
yarn build
):When I navigate to my app, I see "about to render layout" logged out, but then it gets a 404:
Why doesn't the hbs middleare render? Does it send a 404 or does koa send a 404? I can't understand what's happening and how to debug it.
Thank you!
The text was updated successfully, but these errors were encountered: