Romain 'Maz' B.
Romain 'Maz' B.
NNuxt
Created by Romain 'Maz' B. on 7/5/2024 in #❓・help
Migration v2 to v3 increased the build time by 10+
Hi, I was working on a Nuxt2 application. For some reason, the project was forked and migrated to Nuxt3 few months ago. Both project (Nuxt2 & Nuxt3) continued to receive updates. As of today, the Nuxt2 application + a Laravel build is done in less than 2-3 minutes while the Nuxt3 application only (I separated the Laravel app build in the CI/CD) takes an average time of 15-25 minutes and sometimes even more 45! The applications aren't build on equivalent hardware configuration: 8Gb ram, 4vCPU. I trying to improve the performance of the Nuxt3 build during the CI/CD, copying the old node_modules folder from the previous build to not redownload already installed package, using pi0/nuxt-build-cache package and so on... Is that normal that a Nuxt3 build takes way more time to run than Nuxt2? Here are some results information of the builds:
up to date, audited 1398 packages in 26s
[log] Nuxt 3.12.2 with Nitro 2.9.6
[info] vite v5.3.1 building for production...
[info] transforming...
[info] ✓ 2129 modules transformed.
[info] rendering chunks...
[info] computing gzip size...
[info] ✓ built in 2m 42s
[success] Client built in 162181ms
[info] Building server...
[info] vite v5.3.1 building SSR bundle for production...
[info] transforming...
[info] ✓ 1066 modules transformed.
[info] rendering chunks...
[info] ✓ built in 2m 20s
[success] Server built in 140325ms
[info] [nitro] Initializing prerenderer
[info] [nitro] Prerendering 2 routes
[info] [nitro] Prerendered 1 routes in 366.645 seconds
[start] [nuxt-build-cache] Collecting nuxt build cache
[success] [nuxt-build-cache] Nuxt build cache collected in `2612ms`
up to date, audited 1398 packages in 26s
[log] Nuxt 3.12.2 with Nitro 2.9.6
[info] vite v5.3.1 building for production...
[info] transforming...
[info] ✓ 2129 modules transformed.
[info] rendering chunks...
[info] computing gzip size...
[info] ✓ built in 2m 42s
[success] Client built in 162181ms
[info] Building server...
[info] vite v5.3.1 building SSR bundle for production...
[info] transforming...
[info] ✓ 1066 modules transformed.
[info] rendering chunks...
[info] ✓ built in 2m 20s
[success] Server built in 140325ms
[info] [nitro] Initializing prerenderer
[info] [nitro] Prerendering 2 routes
[info] [nitro] Prerendered 1 routes in 366.645 seconds
[start] [nuxt-build-cache] Collecting nuxt build cache
[success] [nuxt-build-cache] Nuxt build cache collected in `2612ms`
Some of these numbers are really weird like it take 6 minutes to prerender one route?!
10 replies
NNuxt
Created by Romain 'Maz' B. on 6/21/2024 in #❓・help
Nuxt content, load images from the assets dir?
Hi! I am reorganizing all my project files and wanted to know if it would be possible to load image files from the assets folder from nuxt content?
title: Looting items
description: 'Items can be looted when defeating mobs. The same item can be looted on various mobs but the chance to loot them can vary depending of the mob.'
image:
src: assets/images/content/looting-system-og-image.png
layout: rules-article
title: Looting items
description: 'Items can be looted when defeating mobs. The same item can be looted on various mobs but the chance to loot them can vary depending of the mob.'
image:
src: assets/images/content/looting-system-og-image.png
layout: rules-article
This doesn't work, I tried with ~/assets, @/assets and so on...
1 replies
NNuxt
Created by Romain 'Maz' B. on 5/30/2024 in #❓・help
useFetch data is correctly filled but data.value is null?!
No description
4 replies
NNuxt
Created by Romain 'Maz' B. on 4/26/2024 in #❓・help
What's the trick to dev/build from nuxt content package fetch from github?
Hi. due to a bug inside the version I was using, I need to be on the really latest update so I modified my package json to use the github repository "@nuxt/content": "github:nuxt/content#main" but since I cannot run dev or build. Here is the log:
Nuxt 3.11.2 with Nitro 2.9.6 17:02:54
ℹ Using default Tailwind CSS file nuxt:tailwindcss 17:02:56

ERROR Error while requiring module @nuxt/content: Error: Cannot find module '/media/SSD/websites/terra-front/@nuxt/content' 17:02:56
Require stack:
- /media/SSD/websites/terra-front/index.js


ERROR Cannot find module '/media/SSD/websites/terra-front/@nuxt/content' 17:02:56
Require stack:
- /media/SSD/websites/terra-front/index.js

Require stack:
- index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Function.resolve (node:internal/modules/cjs/helpers:116:19)
at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:251148)
at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:2210:29)
at requireModule (node_modules/@nuxt/kit/dist/index.mjs:2215:24)
at loadNuxtModuleInstance (node_modules/@nuxt/kit/dist/index.mjs:2451:92)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2407:47)
at async initNuxt (node_modules/nuxt/dist/index.mjs:4233:7)
at async loadNuxt (node_modules/nuxt/dist/index.mjs:4331:5)
at async Module.loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2570:19)



ERROR Cannot find module '/media/SSD/websites/terra-front/@nuxt/content' 17:02:56
Require stack:
- /media/SSD/websites/terra-front/index.js
Nuxt 3.11.2 with Nitro 2.9.6 17:02:54
ℹ Using default Tailwind CSS file nuxt:tailwindcss 17:02:56

ERROR Error while requiring module @nuxt/content: Error: Cannot find module '/media/SSD/websites/terra-front/@nuxt/content' 17:02:56
Require stack:
- /media/SSD/websites/terra-front/index.js


ERROR Cannot find module '/media/SSD/websites/terra-front/@nuxt/content' 17:02:56
Require stack:
- /media/SSD/websites/terra-front/index.js

Require stack:
- index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Function.resolve (node:internal/modules/cjs/helpers:116:19)
at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:251148)
at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:2210:29)
at requireModule (node_modules/@nuxt/kit/dist/index.mjs:2215:24)
at loadNuxtModuleInstance (node_modules/@nuxt/kit/dist/index.mjs:2451:92)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2407:47)
at async initNuxt (node_modules/nuxt/dist/index.mjs:4233:7)
at async loadNuxt (node_modules/nuxt/dist/index.mjs:4331:5)
at async Module.loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2570:19)



ERROR Cannot find module '/media/SSD/websites/terra-front/@nuxt/content' 17:02:56
Require stack:
- /media/SSD/websites/terra-front/index.js
2 replies
NNuxt
Created by Romain 'Maz' B. on 4/25/2024 in #❓・help
V8 running out of memory when building Nuxt
Hi! Running a quite large app on a 8Gb ram VPS, my CI/CD pipelines started to fail earlier this day for no reason. Looking at the free space of the VPS, there is ~3.5Gb free memory when running the pipeline and I modified the node option max-old-space-size to 3000.
top - 09:19:24 up 2:15, 1 user, load average: 0.10, 0.17, 0.34
Tasks: 174 total, 1 running, 173 sleeping, 0 stopped, 0 zombie
%Cpu(s): 3.1 us, 0.6 sy, 0.0 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.1 si, 0.5 st
MiB Mem : 7940.7 total, 2707.5 free, 3535.3 used, 2079.9 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 4405.5 avail Mem
top - 09:19:24 up 2:15, 1 user, load average: 0.10, 0.17, 0.34
Tasks: 174 total, 1 running, 173 sleeping, 0 stopped, 0 zombie
%Cpu(s): 3.1 us, 0.6 sy, 0.0 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.1 si, 0.5 st
MiB Mem : 7940.7 total, 2707.5 free, 3535.3 used, 2079.9 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 4405.5 avail Mem
I have absolutely no idea why this is happening so suddenly, does anyone have any clue that I may explore?
1 replies
NNuxt
Created by Romain 'Maz' B. on 11/7/2023 in #❓・help
Dynamic component import
Hi there! Can anyone tell me why this code works:
<game-notepad-buildings-generic :building="buildingOnSelectedTile" />
<game-notepad-buildings-generic :building="buildingOnSelectedTile" />
But not this one:
<component is="game-notepad-buildings-generic"
:building="buildingOnSelectedTile"
/>
<component is="game-notepad-buildings-generic"
:building="buildingOnSelectedTile"
/>
According to the documentation, I should use resolveComponent but this code snippet doesn't work either:
<component :is="resolveComponent('game-notepad-buildings-generic')"
:building="buildingOnSelectedTile"
/>
<component :is="resolveComponent('game-notepad-buildings-generic')"
:building="buildingOnSelectedTile"
/>
And same is true for a camelCase formatted component name.
24 replies