Problems with Nuxt 3.16.1
Hi All,
So, I'm having a couple of issues with the updated Nuxt version.
1. Breakage in
nuxt.config.ts
configuration options (still tracking down, will update later)
2. TRPC complaints that I'm using @trpc/server in a non-server environment
(still tracking down exact combination of packages that causes)
In both cases/repos, downgrading to Nuxt 3.15.4 "fixes" the problem.2 Replies
Hi @humblemodulo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I understand you're experiencing issues after upgrading to Nuxt 3.16.1. Based on the knowledge sources, there are several known issues with Nuxt 3.16.0/3.16.1 that might be related to your problems.
Issue 1: Configuration Options Breaking
Your configuration options breaking in
nuxt.config.ts
might be related to changes in how aliases are handled in Nuxt 3.16. There was a reported issue where the alias
entry stopped working properly in Nuxt 3.16.0:
Github Issue #31339 shows that aliases that worked correctly in v3.15.4 stopped working in v3.16.0. This was fixed in PR #31278, but if you're using an early 3.16.x version, you might still encounter this issue.
Another potential configuration issue could be related to path aliases in the server configuration. Github Issue #31398 reported that tsconfig.server.json
was losing path aliases after upgrading to 3.16.0.
Issue 2: TRPC Server Environment Error
Your TRPC error about using "@trpc/server in a non-server environment" might be related to dependency resolution issues in Nuxt 3.16. Several issues have been reported with dependency resolution:
1. Github Issue #31180 describes a problem with ohash
versions where Nuxt 3.16 uses [email protected]
but some modules might still require [email protected]
. This causes build errors with messages like "X is not exported by Y".
2. Github Issue #31355 specifically mentions "mismatching versions of ohash
lead to hydration failures" in Nuxt 3.16.0.
3. Github Issue #28850 reports a similar error: "This module cannot be imported in server runtime" which was fixed in 3.15.4 but appears to have regressed in 3.16.0.
Workarounds
Until these issues are fixed in newer patch releases, you have a few options:
1. Stay on Nuxt 3.15.4 as you've already discovered works.
2. Try using package overrides to force specific versions of dependencies:
3. If you're using pnpm with shamefully-hoist=true
, this might be causing issues as mentioned in Github Issue #31340.
The Nuxt team is actively working on fixing these issues, so watching for new patch releases (3.16.2+) might provide a solution soon.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@924898811162288160> Kapa.ai is still learning and improving, please let me know how I did by reacting below.