Skip to content
New issue

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

Example doesn't work #40

Open
wbehrens-on-gh opened this issue Jun 3, 2022 · 2 comments
Open

Example doesn't work #40

wbehrens-on-gh opened this issue Jun 3, 2022 · 2 comments

Comments

@wbehrens-on-gh
Copy link

Copying the demo showed in the readme using handlebars

import { Router } from "oak";
import { handlebarsEngine, oakAdapter, viewEngine } from "view_engine";

const router = new Router();

router.use(
  viewEngine(oakAdapter, handlebarsEngine, {
    viewRoot: <string>`${Deno.cwd()}/views/`,
  }),
);

router.use((ctx) => {
  ctx.render("index.hbs", {});
});

export default router;

ctx.render doesn't exist?

@wbehrens-on-gh
Copy link
Author

Task start deno run --allow-net --allow-read src/server.ts
Check file:///home/will/Code/todos/sweet/src/server.ts
error: TS2339 [ERROR]: Property 'render' does not exist on type 'RouterContext<string, ParamsDictionary, Record<string, any>>'.
  ctx.render("index.hbs", {});

@gjuoun
Copy link
Member

gjuoun commented Jun 27, 2022

can you double-check the view-engine version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants