OS: Ubuntu 20.04 LTS
Related issues:
Denjucks: https://github.com/denjucks/denjucks/issues/9
View-engine: https://github.com/deligenius/view-engine/issues/11
// @deno-types="https://deno.land/x/denjucks/mod.d.ts"
import denjucks from "https://deno.land/x/denjucks/mod.js";
console.log(
denjucks.renderString("hello {{ txt }}", {txt: "world"})
);
// /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>
<h1><%=data.name%></h1>
</body>
Both Code1 and Code2 have the same error:
error: Failed to get compiled source code of https://deno.land/[email protected]/path/mod.ts.
Reason: No such file or directory (os error 2)
denjucks is written in JS, and view-engine includes a port version of ejs, which is also written in JS. As the error is related to the import of path module, so I've checked the source code of denjucks and view-engine. However, all the path imports are being used by JS files.
Here is where I found all the path imports:
the import includes path:
is being used by
the import includes path:
is being used by
This issue is sadly present on Windows 10 Pro, Deno 1.1.2 and 1.1.3 as well, not only on Ubuntu.
I got this error while building my docker image with hayd/alpine-deno:latest:
Failed to get compiled source code of https://deno.land/[email protected]/path/mod.ts.
Reason: No such file or directory (os error 2)
I confirmed that there is no issue on macOS.
Any update related to solution?
This issue should be resolved by #6760 which will be released in the next few days.
Most helpful comment
This issue should be resolved by #6760 which will be released in the next few days.