# Migrating from v8 to v9 ## Breaking Changes #### `@zeit/next-typescript` is no longer necessary Next.js will now ignore usage `@zeit/next-typescript` and warn you to remove it. Please remove this plugin from your `next.config.js`. Remove references to `@zeit/next-typescript/babel` from your custom `.babelrc` (if present). Usage of [`fork-ts-checker-webpack-plugin`](https://github.com/Realytics/fork-ts-checker-webpack-plugin/issues) should also be removed from your `next.config.js`. TypeScript Definitions are published with the `next` package, so you need to uninstall `@types/next` as they would conflict. The following types are different: > This list was created by the community to help you upgrade, if you find other differences please send a pull-request to this list to help other users. From: ```tsx import { NextContext } from 'next' import { NextAppContext } from 'next/app' import { NextDocumentContext } from 'next/document' ``` to ```tsx import { NextPageContext } from 'next' import { AppContext } from 'next/app' import { DocumentContext } from 'next/document' ``` #### The `config` key is now a special export on a page You may no longer export a custom variable named `config` from a page (i.e. `export { config }` / `export const config ...`). This exported variable is now used to specify page-level Next.js configuration like Opt-in AMP and API Route features. You must rename a non-Next.js-purposed `config` export to something different. #### `next/dynamic` no longer renders "loading..." by default while loading Dynamic components will not render anything by default while loading. You can still customize this behavior by setting the `loading` property: ```jsx import dynamic from 'next/dynamic' const DynamicComponentWithCustomLoading = dynamic( () => import('../components/hello2'), { loading: () =>
Loading
, } ) ``` #### `withAmp` has been removed in favor of an exported configuration object Next.js now has the concept of page-level configuration, so the `withAmp` higher-order component has been removed for consistency. This change can be **automatically migrated by running the following commands in the root of your Next.js project:** ```bash curl -L https://github.com/zeit/next-codemod/archive/master.tar.gz | tar -xz --strip=2 next-codemod-master/transforms/withamp-to-config.js npx jscodeshift -t ./withamp-to-config.js pages/**/*.js ``` To perform this migration by hand, or view what the codemod will produce, see below: **Before** ```jsx import { withAmp } from 'next/amp' function Home() { return