Nuxt3

This guide shows you how to deploy a Nuxt3 application on Layer0.

Note: Nuxt3 is still in beta and is not recommended for production.

Example

Connector

This framework has a connector developed for Layer0. See Connectors for more information.

System Requirements

Prerequisites

  1. Install the Layer0 CLI.
  2. Sign up for a Layer0 account.

Getting Started

Follow the instructions to create a new Nuxt3 application, run it in a local dev server, and deploy to Layer0.

1. Create a new Nuxt3 application

To create a new Nuxt3 application, run:

Terminal
npx nuxi init <app-name>

Note: Learn more about npx and Creating a new Nuxt3 project.

After the installation is complete, change directory to the new project:

Terminal
cd <app-name> // Change to the directory of your new application

Then install dependencies with the command:

Terminal
npm install
# or
yarn install

2. Add Layer0 to the Nuxt3 application

To add Layer0 to the Nuxt3 application, run:

Terminal
0 init

3. Run the Nuxt3 app locally with Layer0

To run the Nuxt3 app locally with Layer0, run:

Terminal
0 dev

Vist http://localhost:3001 to view the application.

4. Deploy the Nuxt3 app to Layer0

Note: Add or update the name field in the package.json file.

To deploy the Nuxt3 app to Layer0, run:

Terminal
0 deploy

See deploying for more information.

Resources

  1. Routing with EdgeJS
  2. Prefetching with EdgeJS

Troubleshoot

Error: Variable siteSlug of type String! was provided invalid value

This error throws on deployment with 0 deploy. To fix this, add or update the name field in the package.json file.

tsconfig.json:3:13: warning: Cannot find base config file ”./.nuxt/tsconfig.json”

This is a Nuxt3 error. See this GitHub issue