npm run deploy
Otherwise, you should run
package.json
note: you will need to use npm to deploy to Cloudflare because it expects a
package-lock.json file*Setting up automated Cloudflare deployments
You can use Cloudflare Workers Builds to deploy your application on GitHub commits. You connect your GitHub repository to your Worker by following these steps. In the Build settings:- The “Build command” should be set to
npx opennextjs-cloudflare build. - The “Deploy command” should be set to
npx opennextjs-cloudflare deploy. - The environment variables you previously set in
.envmust be copied and set in the “Build variables and secrets” section. This is so thatnpm next buildexecuted by Workers Builds will have access to the environment variables. It needs that access to inline the NEXT_PUBLIC_… variables and access non-NEXT_PUBLIC_… variables needed for SSG pages. If you don’t do this, you’ll find the NEXT_PUBLIC_LAYERCODE_AGENT_ID env variable is missing and your voice agent won’t work.
package.json build command. It should stay as next build.