chore: enable Nuxt typedPages and typescriptPlugin experimental flags - #2
Draft
jasonappah wants to merge 1 commit into
Draft
jasonappah wants to merge 1 commit into
jasonappah wants to merge 1 commit into
Conversation
- typedPages: generated typed router (.nuxt/types/typed-router.d.ts) with
the vue-router sfc-typed-router Volar plugin. useRoute("name") is now
name-checked; path-based calls (navigateTo, router.push, <NuxtLink to>)
get completion via _LiteralUnion, which keeps arbitrary strings allowed.
- typescriptPlugin: registers the @dxup/unimport and @dxup/nuxt language
service plugins for editor DX (auto-import go-to-definition).
Not enabled: routeTypedFetch and strictRouteTypes. Both exist on the nuxt
`4.x` branch but are absent from every published version (4.5.2 is latest),
so the schema rejects them; strictRouteTypes also requires routeTypedFetch.
jasonappah
force-pushed
the
chore/enable-nuxt-experimental-type-safety
branch
from
September 26, 2026 15:44
c2510c0 to
0520cee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
experimental.typedPagesGenerates a typed route map so route names and paths are checked.
typedPagesexperimental.typescriptPluginRegisters the
@dxup/nuxtlanguage-service plugin for editor DX.typescriptPluginNot enabled:
routeTypedFetch,strictRouteTypesrouteTypedFetch·strictRouteTypesBoth are merged into nuxt
4.x(PR #36238, 2026-09-02) but are in no published release — 4.5.2 shipped 2026-08-05, before the merge. Verified against freshly downloaded npm tarballs: the flags are absent from both@nuxt/schema@4.5.2and thenuxt@4.5.2runtime, and@nuxt/schemarejects them withTS2353.strictRouteTypesalso requiresrouteTypedFetch.nuxt.com serves
/docs/4.x/from the4.xbranch rather than the release tag, so it documents flags that are not yet installable. Worth enabling when the next 4.x ships.Type checking: unchanged
typescript.typeCheckstaysNODE_ENV !== 'production'— dev only, as ondev. Verifiednuxt devstill reports type errors (ERROR(vue-tsc)), anddocker buildpasses untouched.Turning it on for
nuxt builddoes fail the Docker deploy, and the fix is one line in the Dockerfile rather than anything innuxt.config.ts:postinstallrunsnuxt prepareduringpnpm i, beforeCOPY . .lands the app source, so.nuxtholds incomplete type artifacts and the in-build typecheck reports ~10 bogus errors (unresolved auto-imports, module types). Re-preparing after the source copy fixes it — confirmed by a realdocker buildwhere a deliberately introduced type error then failed the build.Left out here to keep the deploy path untouched. Note CI already gates every PR with
pnpm typecheck, so build-time typechecking is a redundant second gate rather than new coverage. Happy to split it into a follow-up.Notes
typedPagesenforcesuseRoute('name')but leavesnavigateTo/router.push/<NuxtLink to>open to any string — vue-router types those as_LiteralUnion<KnownPaths, string>, so they get completion, not enforcement. Intentional upstream, not a misconfiguration..nuxtrcappears as untracked after running tests; it is generated by@nuxt/test-utilsand is unrelated to this branch.