# Migrating from 2.0 to 3.0 | Riverpod
URL: https://riverpod.dev/docs/3.0_migration

Migrating from 2.0 to 3.0 | Riverpod

# Migrating from 2.0 to 3.0

For the list of changes, please refer to the What's new in Riverpod 3.0 page.

Riverpod 3.0 introduces a number of breaking changes that may require you to update your code. They should in general be relatively minor, but we recommend you to read this page carefully.

info

This migration is supposed to be smooth. If there is anything that is unclear, or if you encountered a scenario that is difficult to migrate, please open an issue.

It is important to us that the migration is as smooth as possible, so we will do our best to help you, improve the migration guide, or even include helpers to make the migration easier.

## Automatic retry​

Riverpod 3.0 now automatically retries failing providers by default. This means that if a provider fails to compute its value, it will automatically retry until it succeeds.

In general, this is a good thing as it makes your app more resilient to transient errors. However, you may want to disable/customize this behavior in some cases.

To disable automatic retry globally, you can do so on `ProviderContainer`/`ProviderScope`:

- ProviderScope
- ProviderContainer

```dart
void main() {  runApp(    ProviderScope(      // Never retry any provider      retry: (retryCount, error) => null,      child: MyApp(),    ),  );}
```

```dart
void main() {  final container = ProviderContainer(    // Never retry any provider    retry: (retryCount, error) => null,  );}
```

Alternatively, you can disable automatic retry on a per-provider basis by using the `retry` parameter of the provider:

```dart
final todoListProvider = NotifierProvider<TodoList, List<Todo>>(  TodoList.new,  // Never retry this specific provider  retry: (retryCount, error) => null,);
```

```dart
// Never retry this specific providerDuration? retry(int retryCount, Object error) => null;@Riverpod(retry: retry)class TodoList extends _$TodoList {  @override  List<Todo> build() => [];}
```

## Out of view providers are paused​

In Riverpod 3.0, out of view providers are paused by default.

There is currently no way to disable this behavior globally, but you can control the pause behavior at the consumer level by using the TickerMode widget.

```dart
class MyWidget extends StatelessWidget {  @override  Widget build(BuildContext context) {    return TickerMode(      enabled: true, // Never pause any descendant listener.      child: Consumer(        builder: (context, ref, child) {          // This "watch" will not follow the automatic pausing behavior          // until TickerMode is removed.          final value = ref.watch(myProvider);          return Text(value.toString());        },      ),    );  }}
```

## Using a Ref after the provider is disposed now throws​

In Riverpod 3.0, using a Ref after its provider has been disposed throws an `UnmountedRefException`. This most commonly happens when a `Ref` is used after an `await`, if the provider was disposed (for example rebuilt, or no longer liste