2. Update to Wrangler v2
This document describes the steps to migrate a project from Wrangler v1 to Wrangler v2. Before updating your Wrangler version, review and complete Migrate webpack projects from Wrangler version 1 if it applies to your project.
Wrangler v2 ships with new features and improvements that may require some changes to your configuration.
The CLI itself will guide you through the upgrade process.
If you had previously installed Wrangler v1 globally using npm, you can uninstall it with:
If you used Cargo to install Wrangler v1, you can uninstall it with:
Now, install the latest version of Wrangler.
To check that you have installed the correct Wrangler version, run:
Now you will test that Wrangler v2 can build your Wrangler v1 project. In most cases, it will build just fine. If there are errors, the command line should instruct you with exactly what to change to get it to build.
If you would like to read more on the deprecated wrangler.toml
fields that cause Wrangler v2 to error, refer to Deprecations.
Run the wrangler dev
command. This will show any warnings or errors that should be addressed.
Note that in most cases, the messages will include actionable instructions on how to resolve the issue.
- Errors need to be fixed before Wrangler can build your Worker.
- In most cases, you will only see warnings. These do not stop Wrangler from building your Worker, but consider updating the configuration to remove them.
Here is an example of some warnings and errors:
Refer to Deprecations for more details on what is no longer supported.