.seally
.seally
DDeno
Created by u_flex on 8/6/2023 in #help
error: No config file found in VS Code
The GA4 tutorial itself seems to have some bugs (and in fact there are two bug reports open on that repo regarding this matter). These modifications should be done on <root>/src/index.ts file. The viewPath is constructed from __dirname using new URL(".", import.meta.url).pathname. However, on Windows this produces something like "/D:/devel/ga4-tutorials/src/". That /D: doesn't look like a valid path. File Explorer doesn't accept it and opens it in a browser, which proceeds to complain that the path doesn't exist. A look at Node's issue tracker (https://github.com/nodejs/node/issues/23026) suggests this behavior is in accordance with the spec. The correct way to actually convert this seems to be change that line to const __dirname = dirname(fromFileUrl(import.meta.url)) (import those functions from Deno std), though I haven't checked if it's still correct on a Unix-based system yet. It's not over yet. Later, there's this line:
file = await Deno.open(__dirname + "public" + filepath, {
read: true,
});
file = await Deno.open(__dirname + "public" + filepath, {
read: true,
});
The new __dirname we've constructed does not have an ending slash. This should actually call join() (again, from Deno std) instead of doing string concatenation. Adding the slash yourself ("/public") seems to also work. Maybe. I actually would go ahead and change the initialization of viewPath to use join() instead of string interpolation as well just to be safe, but at the moment it doesn't seem to cause any issues. Looks like there are similar issues in the index.ts under the tutorials/ folder as well.
14 replies