When compiling a template from a string using {{ include ... }}, if the file argument of runString() is left undefined, the following error is thrown:
node:internal/modules/run_main:115
triggerUncaughtException(
^
NotFound [Error]: ENOENT: no such file or directory, open 'partial.vto'
at async open (node:internal/fs/promises:639:25)
at async readFile (node:internal/fs/promises:1246:14)
at async Object.readTextFile (/***/tests/vento/node_modules/.pnpm/@deno+shim-deno@0.18.2/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFile.js:12:16)
at async FileLoader.load (file:///***/tests/vento/node_modules/.pnpm/ventojs@0.12.6/node_modules/ventojs/esm/src/loader.js:10:21)
at async Environment.load (file:///***/tests/vento/node_modules/.pnpm/ventojs@0.12.6/node_modules/ventojs/esm/src/environment.js:86:38)
at async Environment.run (file:///***/tests/vento/node_modules/.pnpm/ventojs@0.12.6/node_modules/ventojs/esm/src/environment.js:18:26)
at async eval (eval at compile (file:///***/tests/vento/node_modules/.pnpm/ventojs@0.12.6/node_modules/ventojs/esm/src/environment.js:45:29), <anonymous>:11:17)
at async Environment.runString (file:///***/tests/vento/node_modules/.pnpm/ventojs@0.12.6/node_modules/ventojs/esm/src/environment.js:32:16)
at async file:///***/tests/vento/test.js:10:18 {
code: 'ENOENT'
}
Vento should be able to include files without needing the file argument to be set.
Desktop
OS: macOS Sonoma 14.5
Node version: v22.4.0 (also reproducable on Node 20)
Vento: 0.12.8
Additional context
If the file argument has to be set for caching purposes, my use case for eleventy-plugin-vento might benefit from not having the cache to begin with (see #71).
Describe the bug
When compiling a template from a string using
{{ include ... }}
, if the file argument ofrunString()
is left undefined, the following error is thrown:To Reproduce
cd
to repositorynpm install
node test.js
Expected behavior
Vento should be able to include files without needing the
file
argument to be set.Desktop
Additional context
If the
file
argument has to be set for caching purposes, my use case foreleventy-plugin-vento
might benefit from not having the cache to begin with (see #71).