D
Deno

help

error: No config file found in VS Code

Uu_flex8/6/2023
I'm new in Deno and in coding, and need help with the following issue. I have installed Deno through VS Code terminal and when I'm trying to run deno start task getting error: No config file found, also when trying to run deno run --allow-net --allow-read ./src/index.ts getting error: Module not found "file:///C:/Users/User/Documents/VS%20Code%20Projects/src/index.ts" message. RN I'm in the process of learning Google Analytics 4 and I'm trying to run local web server according to https://github.com/googleanalytics/ga4-tutorials/blob/main/README.md
GitHub
ga4-tutorials/README.md at main · googleanalytics/ga4-tutorials
Contribute to googleanalytics/ga4-tutorials development by creating an account on GitHub.
Mmarvinh.8/6/2023
When running deno task start deno looks file a deno.json or deno.jsonc file in the current directory. Inside this config file you can define some common tasks for your project, which is typically done to save some typing. In this case you're trying to run a task named start with your command. An example of how such a config file might like:
{
"tasks": {
"start": "deno run -A my-file.ts"
}
}
{
"tasks": {
"start": "deno run -A my-file.ts"
}
}
But in your case it looks like such a file doesn't even exist. So deno throws a "no config file found" error. Common mistakes are that you're executing the command in the wrong folder. Regarding to the other "Module not found" error: That error is thrown when the requested file doesn't exist on your file system. There simply isn't a file at C:/Users/User/Documents/VS Code Projects/src/index.ts . Could be that you typed the path wrong or you are in the wrong directory. If you cloned the linked ga4-tutorials repository you need to move into the project folder in your shell to be able to run the commands. It looks like that's the cause for both of the errors you're seeing
Uu_flex8/7/2023
Thanks for the detailed explanation, it was very helpful. But, now I'm getting Error: Syntax error in file name, folder name, or volume label. (os error 123): lstat 'C:\C:\Users\User\Documents\VS%20Code%20Projects\ga4-tutorials-main\src\public\index.et
Mmarvinh.8/7/2023
huh why are there duplicate path segments? C:\C:\ looks super wrong
Uu_flex8/7/2023
In the process of connecting to http://localhost:80/ I'm getting error message as I stated above
No description
Mmarvinh.8/7/2023
Do you have a repo we can take a look at?
Uu_flex8/7/2023
GitHub
GitHub - googleanalytics/ga4-tutorials
Contribute to googleanalytics/ga4-tutorials development by creating an account on GitHub.
Mmarvinh.8/7/2023
Works fine for me. These are the steps I did
No description
Mmarvinh.8/7/2023
No description
Uu_flex8/7/2023
I've repeated every step according to the screenshot above but keep getting this error
No description
Mmarvinh.8/7/2023
maybe the messed something up when it comes to windows. Can check later today when I'm back home and have access to a windows machine
Uu_flex8/7/2023
Ok, thank you
S.seally8/7/2023
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.
Uu_flex8/8/2023
Thanks for the answer, I've tried all your suggestions and solution from the bug report on that repo but still getting error message

Looking for more? Join the community!

Recommended Posts
Declaration merging for external packagesHi! I'm using unoCSS with Deno Fresh and have been attempting to use the attributify preset (https:Deno.serve AbortController onError. How?When I run my new Deno.serve() updated implementation I get a type error. Perhaps I'm doing it wrongLocalStorage OverrideI'm using a library (@supabase/supabase-js), and I'm compiling my Deno app into an executable, howevBad implementation of X25519?I can't generate a shared secret with the current implementation of X25519 ```ts const alice = awaiResize image/convert on uploadHi there, I want to store images uploaded in webp format at 200x200px. Has anyone done something likI cant import the Zustand module from deno.I leave a photo of what it shows when I put the url to the import map. And try to cache the module.Sub hosting SAAS appWhat technologies are behind the Deno Deploy feature, where you can set up your own domain name? I What should my entry point be on Deno Deploy?Only ever used firebase before. I'm getting a 502 bad gateway error when deploying my website.tsParticles & DenoHi, I’m working on a personal project with Deno & Lume. I’m trying to use tsParticles with preact. Looking for a library to pretty print </br>, <a>, etc tagsAs that title says, I'm looking for a library that can pretty print a string containing the mentioneImporting `puppeteer-cluster` from esm.sh causes `does not provide an export named 'default'` errorWhen importing `https://esm.sh/puppeteer-cluster@0.23.0` I get the following error: ``` error: UncauDeno linting not workingHello everyone, I enabled deno for a subpath in my project (`./supabase`) but unfortunately I'm not deno_pythonI'm trying to use Python with Deno with https://deno.land/x/python@0.2.7 What should I do to enable Deno VS Code plugin too aggressive in auto-completionI'm new to Deno and learning through some tutorials. I'm using VS Code and have the Deno plugin enabhow to exit all async command in deno task?consider this code ```json { "tasks": { "dev-server": "deno run --watch --allow-read --allow-nnode-pre-gyp install failing inside docker containerI'm building something that depends on a library with a native component (pulsar-client) and it doesSet a cookie in GET and retrieve in POSTbeen tryinig to do this for a couple hours now. Basically I want a way to return the user to the prWhat are newUserProps()I'm reading saaskit source, and I don't understand the point of `newUserProps()`. Why not just definRun a detached child process in DenoI'm looking at running a detached child process using Deno. Specifically I want run something like adeno info returns module not found``` deno info https://raw.githubusercontent.com/Murcul/norm/v1.3.0/src/mod.ts error: module could no