DenoDDeno
Powered by
nicetomytyukN
Denoβ€’2y agoβ€’
9 replies
nicetomytyuk

readFile path not found

I'm trying to use Deno.readFile but when is execute i get an error about wrong path.

The files are like this:

- db
- dataservice.ts
- config.sql
- index.ts

Then in daatabservice I try:


   private async getConfig(): Promise<string> {
        const decoder = new TextDecoder("utf-8");
        const bytes = await Deno.readFile("./config.sql");
        return decoder.decode(bytes);
    }
   private async getConfig(): Promise<string> {
        const decoder = new TextDecoder("utf-8");
        const bytes = await Deno.readFile("./config.sql");
        return decoder.decode(bytes);
    }



Error handling product request: NotFound: Impossibile trovare il percorso specificato. (os error 3): readfile './config.sql'
at async Object.readFile (e:\GitHub\GAB-Servizi-SB\eno_fs\30_fs.js:842:18)
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno.readFile broken?
Kas.stKKas.st / help
2y ago
[ERR_MODULE_NOT_FOUND]
[object Object][[object Object] / help
2y ago