opennextjs / opennextjs-netlify

Open Next.js adapter for Netlify
https://opennext.js.org/netlify
661 stars 86 forks source link

[Bug]: Plugin "@netlify/plugin-nextjs" #1361

Closed enzo-mourany closed 2 years ago

enzo-mourany commented 2 years ago

Summary

Plugin "@netlify/plugin-nextjs" failed Error: The directory "/opt/build/repo/build" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.

Steps to reproduce

  1. Deploy the next JS app with netlify

A link to a reproduction repository

No response

Plugin version

4.7.0

More information about your build

What OS are you using?

No response

Your netlify.toml file

`netlify.toml` ```toml # Paste content of your `netlify.toml` file here ```

Your public/_redirects file

`_redirects` ```toml # Paste content of your `_redirects` file here ```

Your next.config.js file

`next.config.js` ```toml # Paste content of your `next.config.js` file here. Check there is no private info in there. ```

Builds logs (or link to your logs)

Build logs ``` # Paste logs here ```

Function logs

Function logs ``` # Paste logs here ```

.next JSON files

generated .next JSON files ``` # Paste file contents here. Please check there isn't any private info in them # You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time. ```
ascorbic commented 2 years ago

Hi @enzo-mourany Can you provide some more details of your setup please, including your build command and your next.config.js

enzo-mourany commented 2 years ago

Sure @ascorbic

Build command : nom run build next.config.js :

`/* @type {import('next').NextConfig} / const nextConfig = { reactStrictMode: true, }

module.exports = nextConfig; `

ascorbic commented 2 years ago

Thanks. Can you change your publish directory from build to .next, either in the UI or in the netlify.toml

enzo-mourany commented 2 years ago

It's work, thanks @ascorbic