deligenius / view-engine

🚀A Template View Engine for Deno frameworks
MIT License
54 stars 15 forks source link

error: Failed to get compiled source code of https://deno.land/std@0.59.0/fs/mod.ts. Reason: The system cannot find the path specified. (os error 3) #11

Closed avudaiappan-cse closed 4 years ago

avudaiappan-cse commented 4 years ago

Directory /   app.ts   index.ejs

app.ts


import { Application } from "https://deno.land/x/oak/mod.ts";
import {
  viewEngine,
  engineFactory,
  adapterFactory,
} from "https://deno.land/x/view_engine/mod.ts";

const ejsEngine = engineFactory.getEjsEngine();
const oakAdapter = adapterFactory.getOakAdapter();

const app = new Application();

app.use(viewEngine(oakAdapter, ejsEngine));

app.use(async (ctx, next) => {
  ctx.render("index.ejs", { data: { name: "John" } });
});

await app.listen({ port: 8000 });

index.ejs <body> Hobbies of <%=data.name%> </body>

Deno version deno 1.1.2

gjuoun commented 4 years ago

As release v1.2.0 mentioned, the view-engine v1.2.0 is bounded to oak v5.3.1

Please use it as follow

// app.ts
import { Application } from "https://deno.land/x/oak@v5.3.1/mod.ts";
import {
  viewEngine,
  engineFactory,
  adapterFactory,
} from "https://deno.land/x/view_engine@v1.2.0/mod.ts";

//... your code
gjuoun commented 4 years ago

Fixed @ 0ff656a

gjuoun commented 4 years ago

Tests passed in macOS and Windows 10 but failed in ubuntu. I assume it's Deno's compiler problem. Further investigation is needed.