cli icon indicating copy to clipboard operation
cli copied to clipboard

Deno support

Open BlueskyFR opened this issue 1 year ago • 18 comments

Describe the feature

Hi! It would be super nice to be able to develop with/install Nuxt using Deno, as the only listed options so far are npm, pnpm, yarn & bun 😊

Additional information

  • [ ] Would you be willing to help implement this feature?
  • [ ] Could this feature be implemented as a module?

Final checks

BlueskyFR avatar Nov 15 '24 20:11 BlueskyFR

Do you mean add Deno starter to docs? Nuxt is compatible with Deno.

typed-sigterm avatar Nov 17 '24 13:11 typed-sigterm

He probably meant Nuxi package manager options when creating a new project. When selecting npm and then trying to run deno task build it throws these errors a bunch: Image

web-dev-sam avatar Nov 17 '24 15:11 web-dev-sam

Yes I meant that! And also to use deno instead of npm to install dependencies, so to add abother option "deno" alongside bun, nom, yarn and others. Because I don't want to have to install npm if I already have deno. And I am getting the same error yes!

BlueskyFR avatar Nov 17 '24 16:11 BlueskyFR

After some source code delving I found out you can build nuxt using Deno by adding nitro: { preset: 'deno' } to your nuxt config. However I did not find a way to make it work for the development server so that it works. I assume that there isn't support for that yet. The issue could be related to some fs.stat or fs.statSync not receiving proper arguments (deno-node polyfill). But since the stacktrace is too small I don't know much more.

web-dev-sam avatar Nov 17 '24 16:11 web-dev-sam

Is https://github.com/nuxt/cli/pull/526 solving this issue? Gotta confirm that

BlueskyFR avatar Dec 08 '24 22:12 BlueskyFR

Well when using the Nuxt UI starter with Deno I am getting a 500 server error for now:

[nuxt] [request error] [unhandled] [500] Cannot find module 'vue'

Just after running deno task dev

BlueskyFR avatar Dec 08 '24 22:12 BlueskyFR

Does it help if you add vue as a dependency?

danielroe avatar Dec 09 '24 10:12 danielroe

Deno seems to work fine in a new project with the latest CLI changes.

I checked UI template and installing vue does resolve the issue, so I added it to package.json.

danielroe avatar Dec 11 '24 15:12 danielroe

@danielroe can you please reopen? This does not look fixed to me.

When creating a new project using deno run -A npm:nuxi@latest init -t ui, and then deno task dev I get this: Image instead of (same project but using Yarn instead of Deno): Image

So I think this issue should still be opened 😅

BlueskyFR avatar Dec 23 '24 00:12 BlueskyFR

you're right, there's an issue:

Image

would you raise it upstream with deno? this doesn't seem like a nuxt bug to me.

danielroe avatar Dec 23 '24 22:12 danielroe

Probably related (https://github.com/denoland/deno/issues/26700, https://github.com/denoland/deno/pull/23289)

pi0 avatar Dec 23 '24 22:12 pi0

@danielroe how are you getting that? I don't have any error on my side:Image

BlueskyFR avatar Dec 23 '24 23:12 BlueskyFR

Are you sure you are using Deno 2.1.4? I think your issue might be already fixed

BlueskyFR avatar Dec 23 '24 23:12 BlueskyFR

quite right, this computer still had v2.0.6

danielroe avatar Dec 23 '24 23:12 danielroe

transferred to CLI to handle receiving ERROR [unhandledRejection] Unknown signal: 0 when exiting dev server

danielroe avatar Dec 23 '24 23:12 danielroe

Alright! I agree on that but this specific exit code isn't that important to me, the main problem is the rendered page and I have to admit I have no clue on how to debug that.

BlueskyFR avatar Dec 23 '24 23:12 BlueskyFR

@BlueskyFR the css issue is unlikely to be nuxt related - it could be tailwindcss or nuxt/ui related - maybe raise there?

danielroe avatar Dec 23 '24 23:12 danielroe

@BlueskyFR the css issue is unlikely to be nuxt related - it could be tailwindcss or nuxt/ui related - maybe raise there?

why not, how can I debug that in your opinion? Since we are not really seeing any error here tbh

BlueskyFR avatar Dec 24 '24 00:12 BlueskyFR