N
Nuxt3mo ago
Nawi

UI 4 failed on build

I have this problem on my project and it kept bugging me since nuxt-ui-pro. I have the same build fails and cant find a way to solve it, the build process is halted here
(node:18280) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\2026\kontraktor\node_modules\.pnpm\nuxt-og-image@5.1.11_@unhea_b0f0cbc75f8d6adaf5b86a8c8d847a1d\node_modules\@unocss\preset-wind3\package.json imported from D:\2026\kontraktor\node_modules\.pnpm\nuxt-og-image@5.1.11_@unhea_b0f0cbc75f8d6adaf5b86a8c8d847a1d\node_modules\nuxt-og-image\dist\runtime\server\og-image\context.js. Mapping specifiers ending in "/" is no longer supported.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:18280) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\2026\kontraktor\node_modules\@unocss\preset-wind3\package.json imported from D:\2026\kontraktor\node_modules\. Mapping specifiers ending in "/" is no longer supported.
(node:18280) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\2026\kontraktor\node_modules\.pnpm\nuxt@4.1.2_@netlify+blobs@9_842db8852b10ec39113d96819df5c34a\node_modules\@vue\shared\package.json imported from D:\2026\kontraktor\node_modules\.pnpm\nuxt@4.1.2_@netlify+blobs@9_842db8852b10ec39113d96819df5c34a\node_modules\nuxt\dist\core\runtime\nitro\templates\error-500.js. Mapping specifiers ending in "/" is no longer supported.
(node:18280) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\2026\kontraktor\node_modules\.pnpm\nuxt-og-image@5.1.11_@unhea_b0f0cbc75f8d6adaf5b86a8c8d847a1d\node_modules\@unocss\preset-wind3\package.json imported from D:\2026\kontraktor\node_modules\.pnpm\nuxt-og-image@5.1.11_@unhea_b0f0cbc75f8d6adaf5b86a8c8d847a1d\node_modules\nuxt-og-image\dist\runtime\server\og-image\context.js. Mapping specifiers ending in "/" is no longer supported.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:18280) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\2026\kontraktor\node_modules\@unocss\preset-wind3\package.json imported from D:\2026\kontraktor\node_modules\. Mapping specifiers ending in "/" is no longer supported.
(node:18280) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\2026\kontraktor\node_modules\.pnpm\nuxt@4.1.2_@netlify+blobs@9_842db8852b10ec39113d96819df5c34a\node_modules\@vue\shared\package.json imported from D:\2026\kontraktor\node_modules\.pnpm\nuxt@4.1.2_@netlify+blobs@9_842db8852b10ec39113d96819df5c34a\node_modules\nuxt\dist\core\runtime\nitro\templates\error-500.js. Mapping specifiers ending in "/" is no longer supported.
around 20 minutes, and then i got build failed "javascript out of heap memory". Response anyone?
2 Replies
kapa.ai
kapa.ai3mo ago
Hi @Nawi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The issue you're encountering is related to a deprecation warning in Node.js about the use of trailing slash pattern mapping ("./") in the "exports" field of some packages, specifically @unocss/preset-wind3 and possibly others. This warning is triggered during the build process and, while it's a warning, it can sometimes be accompanied by other issues such as "JavaScript out of heap memory" errors, which halt your build. From the knowledge sources, there is no direct fix for the deprecation warning itself, as it comes from how dependencies (like @unocss/preset-wind3) are authored. However, this warning alone should not cause the build to fail; the "out of heap memory" error is likely the main culprit for the build failure. What you can do: 1. Increase Node.js Memory Limit:
The "out of heap memory" error can be mitigated by increasing the memory limit for Node.js during the build. You can do this by prefixing your build command with:
node --max-old-space-size=4096 node_modules/.bin/nuxt build

node --max-old-space-size=4096 node_modules/.bin/nuxt build

Adjust the number (4096 = 4GB) as needed for your system. 2. Check for Known Issues and Workarounds:
There are recent issues with Nuxt 4.x and related modules (including UI Pro and UnoCSS) that can cause build failures. For example, some users have reported build errors with Nuxt UI and composables, and a temporary workaround is to downgrade Nuxt to 4.1.0 if you are on 4.1.1 or later, as some bugs were introduced in recent versions and are being addressed by the Nuxt team. See the discussion and workaround here: Nuxt 4.1.1: Nuxt Build Error: [nuxt:tree-shake-composables:transform] Cannot split a chunk that has already been edited. 3. Deprecation Warning:
The deprecation warning itself is not immediately actionable unless you are the maintainer of the affected packages. It is up to the package authors (e.g., UnoCSS, Nuxt modules) to update their "exports" field to remove the trailing slash mapping. You can monitor the relevant repositories for updates or open an issue if one does not already exist. 4. Keep Dependencies Updated:
Since these issues are actively being worked on, make sure to keep your Nuxt and related dependencies up to date, as fixes are likely to be released soon. Summary:
- The deprecation warning is not the direct cause of the build failure, but the "out of heap memory" error is. - Increase Node.js memory for the build process. - Consider downgrading Nuxt if you are on a version with known build bugs. - Watch for updates from UnoCSS and Nuxt regarding the deprecation warning. If you continue to experience issues after these steps, please provide more details about your project setup and dependencies, as there may be a deeper compatibility issue at play. Let me know if you need help with the exact commands or configuration changes! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@969851557954879488> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?