Packages

@nuxt/server

2.18.1 · 28 Jun 2024MIT163.2k / weekRepositoryHomepagenpmAtom feed

Deprecated by its maintainers: Nuxt 2 has reached EOL and is no longer actively maintained. See https://nuxt.com/blog/nuxt2-eol for more details.What to use instead
Your version

2.16.0

3 Feb 2023Where it was published

2.18.1 is the newest release of 2.x.

npm marks 2.16.0 as deprecated: Nuxt 2 has reached EOL and is no longer actively maintained. See nuxt.com/blog/nuxt2-eol for more details.

In short

5 breaking13 new28 fixed42 internal

  • Breaking

    Upgrade to PostCSS 8

  • Breaking

    In this PR we only support Node 14+. This is mostly an issue for dependencies, which we need to keep updated for security reasons. Going forward until its own EOL, Nuxt 2 will only officially support Node versions that have not reached their EOL.

  • Breaking

    Dependency upgrades. A number of dependencies have dropped support for earlier node versions. dotenv has changed how it parses .env files in a number of edge cases. glob now requires / instead of \ on windows machines. There may also be other changes that affect your usage, so please do upgrade with care.

  • Breaking

    Vue 2.7 upgrade. Although you can use Vue 2.7 with any release of Nuxt 2, 2.16.0 for the first time includes it as a dependency, which means that you may well encounter some issues associated with upgrading Vue 2.6 -> Vue 2.7.

  • Breaking

    webpack: ⚠️ Update postcss to v8

Release note

Nuxt 2.16.0 is the first minor release since Feb 15, 2021. The focus is mostly on releasing the latest fixes and enhancements that have been present in nuxt-edge for some time.

Highlights

Breaking changes

  • Breaking

    In this PR we only support Node 14+. This is mostly an issue for dependencies, which we need to keep updated for security reasons. Going forward until its own EOL, Nuxt 2 will only officially support Node versions that have not reached their EOL.

  • Breaking

    New postcss options format. See #9671 for full details.

  • Breaking

    Dependency upgrades. A number of dependencies have dropped support for earlier node versions. dotenv has changed how it parses .env files in a number of edge cases. glob now requires / instead of \ on windows machines. There may also be other changes that affect your usage, so please do upgrade with care.

  • Breaking

    Vue 2.7 upgrade. Although you can use Vue 2.7 with any release of Nuxt 2, 2.16.0 for the first time includes it as a dependency, which means that you may well encounter some issues associated with upgrading Vue 2.6 -> Vue 2.7.

    This may be a good time to consider using the composition API utilities provided by github.com/nuxt/bridge instead, which mirror Nuxt 3's more precisely than @nuxtjs/composition-api. (You can opt-in to just these utilities by disabling the other bridge modules individually.)

Changelog

compare changes

Enhancements

  • config: Support nuxtrc in dist directory

  • generator: Add ignoreEnv generate option during ensureBuild(cmd)

  • server: Allow disabling serve-static middleware

  • types: Add asyncData return types to component instance type

  • vue-app: context.beforeSerialize method

  • vue-app: Pass store to createRouter

  • Default to core-js version 3

  • webpack: ⚠️ Update postcss to v8

Fixes

  • vue-app: Respect scroll-margin-top when navigating with hash

  • webpack: Use javascript/auto for js rule

  • server: Unregister error event listener

  • babel-preset-app: Respect explicit options.targets for modern preset

  • types: Add nuxt.config alias type

  • vue-app: Check whether route exists within nuxt app before replacing

  • vue-renderer: Decode route path for payload.js

  • vue-app: Don't normalise route path if it's valid

  • vue-app: Redirect to external url replaces current history entry

  • utils: trailingSlash causes error with dynamic nuxt-child routes

  • types: Add onNuxtLoaded and onNuxtReady types

  • vue-app: Re-register components construtor in HMR

  • types: Add typing for build.stats options

  • babel: Loose option for babel private-property-in-object

  • vue-app: Serialize route meta to allow functions

  • vue-app: null check for $root access

  • generator: Allow passing builder to getGenerator

  • generator: Throw an error when Builder is missing

  • vue-app: Use correct $config for finding basePath

  • vue-renderer: Ensure custom build indicator preserves some whitespace

  • 'npm run test' fails because the last command lacks 'yarn'

  • generator: Decode path with ufo

  • cli: Ensure nuxt instance is closed when skipping build

  • Nuxt-child-key in web-types.json

  • types: Return type of $fetch

  • deps: Update ya-parser-js to latest 0.7.x

  • vue-app: Call ssrContext.unsetMutationObserver only if it exists

  • webpack: Allow files with .cjs extension to be transpiled

  • vue-app: Preview mode fetch

  • webpack: Resolve .wasm extension with lower priority

  • vue-app: Clear hide timeout when calling clear()

Types

  • Add prefetchPayloads to router options

CI

Breaking Changes

  • Breaking

    webpack: ⚠️ Update postcss to v8

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.