Node/Nuxt.js: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Operation =
== Quick Start ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
npm create nuxt@latest test-nuxt
npm create nuxt@latest test-nuxt
Line 5: Line 9:
pnpm dev
pnpm dev
</syntaxhighlight>
</syntaxhighlight>


= Trouble Shooting =
= Trouble Shooting =


== Slow in WSL ==
== Slow in WSL ==
Accessing the Windows host’s folders from WSL causes a lot of I/O overhead, which makes Node builds take way too long.
You should move the project to the WSL internal filesystem and use the VSCode WSL extension to develop instead.
* Move repo into WSL native filesystem.
* Install WSL extension on VSCode of host.
* Add WSL repo directory into workspace.


<syntaxhighlight lang="powershell">
<syntaxhighlight lang="powershell">
$ nuxt dev
│                                                                                                                                    2:14:45 PM
●  Nuxt 4.5.2 (with Nitro 2.13.4, Vite 8.2.2 and Vue 3.5.42)
                                                                                                                                      2:14:45 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose
  ➜ DevTools: press Shift + Alt + D in the browser (v3.4.2)                                                                          2:14:58 PM


WARN  [NUXT_B8014] Module @nuxt/devtools was slow to set up, taking 7352.2ms.                                                        2:14:58 PM
╰▶ fix: Defer expensive operations to a later hook (e.g. build:before) to reduce startup time.
</syntaxhighlight>
</syntaxhighlight>



Latest revision as of 06:28, 9 September 2026

Operation

Quick Start

npm create nuxt@latest test-nuxt
cd test-nuxt
pnpm approve-builds
pnpm dev

Trouble Shooting

Slow in WSL

Accessing the Windows host’s folders from WSL causes a lot of I/O overhead, which makes Node builds take way too long.

You should move the project to the WSL internal filesystem and use the VSCode WSL extension to develop instead.

  • Move repo into WSL native filesystem.
  • Install WSL extension on VSCode of host.
  • Add WSL repo directory into workspace.
$ nuxt dev
                                                                                                                                     2:14:45 PM
  Nuxt 4.5.2 (with Nitro 2.13.4, Vite 8.2.2 and Vue 3.5.42)
                                                                                                                                      2:14:45 PM
   Local:    http://localhost:3000/
   Network:  use --host to expose

   DevTools: press Shift + Alt + D in the browser (v3.4.2)                                                                           2:14:58 PM


 WARN  [NUXT_B8014] Module @nuxt/devtools was slow to set up, taking 7352.2ms.                                                        2:14:58 PM
╰▶ fix: Defer expensive operations to a later hook (e.g. build:before) to reduce startup time.

Cannot access WSL Ubuntu

New-NetFirewallRule -DisplayName "Nuxt WSL Port 3000" -Direction Inbound -LocalPort 3000 -Protocol TCP -Action Allow