w7a9q
w7a9q
Explore posts from servers
DDeno
Created by w7a9q on 11/8/2024 in #help
Getting version out of deno.json
deno compile
5 replies
DDeno
Created by w7a9q on 11/2/2024 in #help
Cannot run Nitro project
The problem persists even in canary. I will submit it on the GitHub. Thanks
8 replies
DDeno
Created by w7a9q on 11/2/2024 in #help
Cannot run Nitro project
2.0.4
8 replies
DDeno
Created by w7a9q on 11/1/2024 in #help
Deno runs the whole script instead of the method
It starts with:
import { exec } from "node:child_process";
import process from "node:process";

const directoryArg: string = process.argv[2];
const qualityArg: string = process.argv[3];
import { exec } from "node:child_process";
import process from "node:process";

const directoryArg: string = process.argv[2];
const qualityArg: string = process.argv[3];
I expected to run only the validateInput method.
4 replies
DDeno
Created by w7a9q on 10/21/2024 in #help
Create SvelteKit project with Deno
I think that doesn't use the Svelte CLI. deno run -A npm:sv create myapp did the trick.
3 replies
DDeno
Created by w7a9q on 9/28/2024 in #help
Corepack
Alright, that could make sense why Corepack is not requested. I will take a look on that implementation. Is it close to pnpm?
9 replies
DDeno
Created by w7a9q on 9/28/2024 in #help
Corepack
Deno uses it's own package manager?
9 replies
DDeno
Created by w7a9q on 9/28/2024 in #help
Corepack
Is there a particular reason?
9 replies
NNuxt
Created by w7a9q on 9/11/2024 in #❓・help
Nitro typecheck
@cuebit The thing is that Nitro uses TypeScript without it being installed. zsh: command not found: tsc
4 replies
NNuxt
Created by w7a9q on 7/12/2024 in #❓・help
Get body of the response
Great! Thanks
13 replies
NNuxt
Created by w7a9q on 7/12/2024 in #❓・help
Get body of the response
The client wants us to verify that the actual response body is JSON.
13 replies
NNuxt
Created by w7a9q on 7/12/2024 in #❓・help
Get body of the response
Yeah but you can use middleware to manipulate with the response as well, right? I don't have any code. I want to write a middleware and read the body of the response I return back from endpoint implemented in the server/api.
13 replies
NNuxt
Created by w7a9q on 7/12/2024 in #❓・help
Get body of the response
HTTP response body
13 replies
NNuxt
Created by w7a9q on 7/10/2024 in #❓・help
async Nitro middleware
That was it! Of course, thank you!
8 replies
NNuxt
Created by w7a9q on 7/10/2024 in #❓・help
async Nitro middleware
No description
8 replies
NNuxt
Created by w7a9q on 7/10/2024 in #❓・help
async Nitro middleware
export default defineEventHandler(async event => {
const body = await readBody(event)

try {
JSON.parse(body)
}
catch {
throw createError({
statusCode: 415,
statusMessage: 'Body is not JSON.',
})
}
})
export default defineEventHandler(async event => {
const body = await readBody(event)

try {
JSON.parse(body)
}
catch {
throw createError({
statusCode: 415,
statusMessage: 'Body is not JSON.',
})
}
})
8 replies
NNuxt
Created by w7a9q on 7/10/2024 in #❓・help
async Nitro middleware
Anyone?
8 replies
NNuxt
Created by w7a9q on 6/17/2024 in #❓・help
Mocking useStorage
Looks like Nitro is not accessible outside of server: https://github.com/nuxt/nuxt/issues/23484#issuecomment-1742010287
4 replies
NNuxt
Created by w7a9q on 6/17/2024 in #❓・help
Mocking useStorage
I have tried adding @vueuse/core package and then importing the function from it: import { useStorage } from '@vueuse/core'. It did not solve the problem. Here is the StackBlitz repl: https://stackblitz.com/edit/nuxt-starter-bf2fpu?file=test%2Futils.test.ts
4 replies
NNuxt
Created by w7a9q on 6/17/2024 in #❓・help
Mocking useStorage
I tried this solution: https://stackoverflow.com/questions/74993530/how-to-test-a-function-that-uses-nitros-usestorage Now the error is thrown from the actual function: ReferenceError: useStorage is not defined - that should beeen autoimported as well. In the post he changes the actual implementation to use mock, I don't want this. What is the best practice about this?
4 replies