Repository navigation
Description
Environment
- OS: Windows
- Node.js:
24.19.0 - Package manager: pnpm
12.3.4 - Nuxt:
4.5.2 - Nitro / nitropack:
2.13.4 - Vue / @vue/shared:
3.5.42 - mlly:
1.8.2 - exsolve:
1.1.1 - Build preset:
node-server - Compatibility date:
2025-12-21
Relevant configuration:
export default defineNuxtConfig({
compatibilityDate: '2025-12-21',
nitro: {
experimental: {
websocket: true,
},
},
})
### Reproduction
he warning occurs during the Nitro server build phase of an existing Nuxt application.
To capture the stack trace, run the build with deprecation tracing enabled. In PowerShell:
```powershell
$env:NODE_OPTIONS = '--trace-deprecation'
pnpm buildI do not currently have a public minimal reproduction repository. However, I traced the warning in the actual build and independently reproduced the dependency-resolution sequence using the installed dependencies.
The isolated sequence is:
// vueFile is the resolved absolute path to:
// @vue/shared/dist/shared.esm-bundler.js
const subpath = await lookupNodeModuleSubpath(vueFile)
// "./"
const specifier = join('@vue/shared', subpath)
// "@vue/shared/"
resolveModuleURL(specifier, {
from: importer,
try: true,
conditions: ['node', 'import', 'production'],
})
// Emits DEP0155 and returns undefined.Here:
lookupNodeModuleSubpathis frommlly.joinis frompathe, as used by Nitro.resolveModuleURLis fromexsolve.importeris the file URL of Nuxt's installederror-500.mjstemplate.
As a control, resolving @vue/shared with the same resolver options succeeds without the warning.
Describe the bug
During the Nitro server build, the node-externals plugin constructs the package specifier @vue/shared/ while trying to infer an importable package subpath. Passing this specifier to exsolve triggers a DEP0155 deprecation warning.
The original import in @nuxt/nitro-server/dist/runtime/templates/error-500.mjs does not contain a trailing slash:
import { escapeHtml } from '@vue/shared'The observed resolution sequence is:
mlly.lookupNodeModuleSubpath()returns"./"for the package root export.- Nitro joins the package name with this subpath.
join('@vue/shared', './')produces@vue/shared/.- Nitro passes that specifier to
exsolve.resolveModuleURL(). exsolveemitsDEP0155while resolving the resulting"./"package subpath.
The actual build stack points to this statement in nitropack/dist/rollup/index.mjs:
const resolvedGuess =
guessedSubpath && tryResolve(join(pkgName, guessedSubpath), importer)Expected behavior
When the inferred subpath represents the package root, Nitro should resolve the bare package name, such as @vue/shared, without introducing a trailing slash.
Actual behavior
Nitro attempts to resolve @vue/shared/, producing the deprecation warning.
Additional context
The installed @vue/shared/package.json contains export keys "." and "./*". It does not contain a separate "./" export key.
Directly importing the Nuxt error-page template with Node.js and --trace-deprecation succeeds without emitting this warning.
Although mlly returns the "./" subpath, the warning in the actual build is emitted by exsolve, called from Nitro's node-externals plugin.
Logs
Local absolute paths have been shortened for readability.
[DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./"
in the "exports" field module resolution of the package at
<project>/node_modules/.pnpm/@[email protected]_<hash>/node_modules/@vue/shared/package.json
imported from
<project>/node_modules/.pnpm/@[email protected]_<hash>/node_modules/@nuxt/nitro-server/dist/runtime/templates/error-500.mjs.
Mapping specifiers ending in "/" is no longer supported.
at emitTrailingSlashPatternDeprecation (exsolve/dist/index.mjs:650:12)
at packageExportsResolve (exsolve/dist/index.mjs:669:38)
at packageResolve (exsolve/dist/index.mjs:771:82)
at moduleResolve (exsolve/dist/index.mjs:809:14)
at _tryModuleResolve (exsolve/dist/index.mjs:915:10)
at resolveModuleURL (exsolve/dist/index.mjs:866:16)
at tryResolve (nitropack/dist/rollup/index.mjs:346:17)
at Object.resolveId (nitropack/dist/rollup/index.mjs:417:51)
at async PluginDriver.hookFirstAndGetPlugin (rollup/dist/es/shared/node-entry.js:22743:28)
at async resolveId (rollup/dist/es/shared/node-entry.js:21205:26)
Isolated reproduction output:
subpath: "./"
specifier: "@vue/shared/"
Resolving: @vue/shared
file:///<project>/node_modules/.pnpm/@[email protected]/node_modules/@vue/shared/dist/shared.cjs.prod.js
Resolving: @vue/shared/
undefined
[DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" ...
Activity
nikolas-sapa commentedon Sep 13, 2026
Confirmed on
v2(nitropack 2.13.4), and your trace is exactly right. Since the report is missing the minimal reproduction the PR template asks for, here is a self-contained one that needs no Nuxt and no network.Minimal reproduction
The trigger needs two things in the dependency's
exportsmap: a root export that resolves to a different file than the one rollup hands Nitro (which is what pushes resolution into the "guess the subpath" branch), and a wildcard key (which is what makes a trailing-slash subpath match a deprecated pattern).@vue/sharedhas both.Same frames as your build trace.
Where the
"./"comes fromIt is not an accident of the package — it is how
mllydenotes the package root.lookupNodeModuleSubpathfalls through to_flattenExports, which builds each entry's subpath withjoinURL(parentSubpath, subpath)starting from"./". For the"."key that isjoinURL("./", "")→"./". So every package root export reverse-maps to"./", andjoin(pkgName, "./")keeps the slash.Then in
exsolve,packageExportsResolveemits DEP0155 whenever the requested subpath ends in/and matches a wildcard key (index.mjs:669) — hence the"./*"requirement above.One consequence not mentioned in the report
The warning is the visible symptom, but
resolveModuleURLalso returnsundefinedfor the trailing-slash specifier. Inexternals.ts#L157-L167that meansresolvedGuess !== id, soresolveIdfalls through toreturn null— the dependency is inlined into the server bundle instead of being externalized. For@vue/sharedthat is small, but it applies to any dependency whose root export resolves differently under Nitro's conditions than under rollup's.Fix
withoutTrailingSlash()(already used elsewhere insrc/) turns"./"into".", andjoin(pkgName, ".")is exactlypkgName:Every other subpath shape is unchanged (
"./dist/x.js"→"pkg/dist/x.js"). And because the guess is only used when it resolves back toid, normalizing the specifier cannot introduce an incorrect external — a wrong guess still fails the equality check and falls through to inlining exactly as before.I have this on a branch with a regression test that asserts no DEP0155 is emitted (it fails without the fix with the message above). Full suite is green locally: unit +
node,nitro-dev,aws-lambda,azure,netlify,netlify-legacy,vercel,staticpresets. Happy to open the PR againstv2if you'd like it.lvzhenbo commentedon Oct 4, 2026
H3 V2 stable release is out; we can now look forward to the stable releases of Nitro V3 and Nuxt V5. Since no one has come forward to resolve this issue, it’s no longer important.