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

Uncaught Error: No such file or directory (os error 2), readdir 'views/partials/' for path "views/partials/" #19

Open
yogiswar1987 opened this issue Dec 14, 2022 · 2 comments

Comments

@yogiswar1987
Copy link

yogiswar1987 commented Dec 14, 2022

Coded just how you asked in a bug
Using
MAC Monterey 12.6
Deno 1.28.3

import { Application, Router, Status } from 'https://deno.land/x/oak/mod.ts'
import { Handlebars } from 'https://deno.land/x/handlebars/mod.ts'

const handle = new Handlebars();
console.log(await handle.renderView('index', {}));

getting below error

IN-MAC-163:ott yreddivari$ deno run --allow-read index.ts
Download ⠇ https://deno.land/x/oak/mod.ts Warning Implicitly using latest version (v11.1.0) for https://deno.land/x/oak/mod.ts
Download ⠋ https://deno.land/x/oak@v11.1.0/mod.ts Warning Implicitly using latest version (v0.9.0) for https://deno.land/x/handlebars/mod.ts
error: Uncaught Error: No such file or directory (os error 2), readdir 'views/partials/' for path "views/partials/"

@yogiswar1987
Copy link
Author

if i create views/partials. folder, below is the error

error: Uncaught NotFound: No such file or directory (os error 2)
const source: string = new TextDecoder().decode(await readFile(path));
^
at async readFile (deno:runtime/js/40_read_file.js:25:20)
at async Handlebars.render (https://deno.land/x/handlebars@v0.9.0/mod.ts:109:53)
at async Handlebars.renderView (https://deno.land/x/handlebars@v0.9.0/mod.ts:84:26)
at async file:///Users/yreddivari/WebstormProjects/deno-handlebars/index.ts:5:13

@yogiswar1987
Copy link
Author

yogiswar1987 commented Dec 14, 2022

After creating layouts/main.hbs below is the response

<div>layout-main</div>

which is content of layouts/main.hbs

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

1 participant