This guide shows you how to deploy a Nuxt3 application to Edgio.
Example
Prerequisites
Setup requires:
- An Edgio account. Sign up for free.
- An Edgio property. Learn how to create a property.
- Node.js. View supported versions and installation steps.
- Edgio CLI.
Install the Edgio CLI
If you have not already done so, install the Edgio CLI.
Bash
1npm i -g @edgio/cli@latest
Getting Started
Follow the instructions to create a new Nuxt3 application, run it in a local dev server, and deploy to Edgio.
1. Create a new Nuxt3 application
To create a new Nuxt3 application, run:
Bash
1npx nuxi init <app-name>
Learn more about npx and Creating a new Nuxt3 project.
After the installation is complete, change directory to the new project:
Bash
1cd <app-name> // Change to the directory of your new application
Then install dependencies with the command:
Bash
1npm install # yarn install
2. Add Edgio to the Nuxt3 application
To add Edgio to the Nuxt3 application, run:
Bash
1edgio init --edgioVersion latest
3. Run the Nuxt3 app locally with Edgio
To run the Nuxt3 app locally with Edgio, run:
Bash
1edgio dev
Vist http://localhost:3000 to view the application.
4. Run the Nuxt3 app in local production mode with Edgio
To run the Nuxt3 app in local production mode with Edgio, run:
Bash
1edgio build && edgio run --production
5. Deploy the Nuxt3 app to Edgio
Deploy your app to Edgio by running the following command in your project’s root directory:
Bash
1edgio deploy
Your initial CDN-as-code deployment will generate system-defined origin configurations along with those defined within your
edgio.config.js
. Learn more about system-defined origins.See Deployments for more information.
Resources
Troubleshoot
Error: Variable siteSlug of type String! was provided invalid value
This error throws on deployment with
edgio deploy
. To fix this:- Add/Update the
name
field in thepackage.json
file, OR - Deploy with the name flag, via,
edgio deploy --name=site-slug
tsconfig.json:3:13: warning: Cannot find base config file ”./.nuxt/tsconfig.json”
This is a resolved Nuxt3 error. More on this GitHub Issue.