N
Nuxt3w ago
w7a9q

Nitro in Deno

I have created a new Nitro project using deno run -A npm:giget@latest nitro nitro-app --install. It was successfull but after trying deno run dev I get an error saying:
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pathname')
at getPathname (ext:deno_node/_fs/_fs_stat.ts:177:49)
at ext:deno_node/_fs/_fs_stat.ts:151:13
at eventLoopTick (ext:core/01_core.js:175:7)
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pathname')
at getPathname (ext:deno_node/_fs/_fs_stat.ts:177:49)
at ext:deno_node/_fs/_fs_stat.ts:151:13
at eventLoopTick (ext:core/01_core.js:175:7)
Is there any fix for that or is it a bug in Deno itself?
2 Replies
kapa.ai
kapa.ai3w ago
Hi @w7a9q. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the knowledge sources, I can offer some insights about using Nitro with Deno, but I don't have specific information about the error you're encountering. Let me explain what I know: Nitro does support running applications with the Deno runtime, as mentioned in the Deno runtime documentation (https://nitro.unjs.io/deploy/runtimes/deno). However, the process described there is slightly different from what you've attempted. According to the documentation, the recommended steps are: 1. Build your Nitro server using Node.js with the Deno preset:
NITRO_PRESET=deno_server npm run build
NITRO_PRESET=deno_server npm run build
2. Then start the production server using Deno:
deno run --unstable --allow-net --allow-read --allow-env .output/server/index.ts
deno run --unstable --allow-net --allow-read --allow-env .output/server/index.ts
The error you're encountering seems to be related to Deno trying to read a file or directory path, but it's not clear why this is happening during the deno run dev command. It's worth noting that the documentation doesn't mention a dev command for Deno. The example provided is for running the production build. Given this information, I would suggest trying the following: 1. Make sure you have built your project using the Deno preset as mentioned above. 2. Try running the production server using the command provided in the documentation. If you continue to encounter issues, it might be worth checking if there's a bug report for this specific error on the Nitro GitHub issues page (https://github.com/unjs/nitro/issues). If not, you may want to consider opening a new issue there with the details of your setup and the error you're encountering. Unfortunately, I don't have enough information to determine if this is a bug in Deno itself or an issue specific to Nitro's Deno integration. More investigation would be needed to make that determination. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@1216792075425677402> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Want results from more Discord servers?
Add your server