Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
enzo-mourany opened this issue May 25, 2022 · 4 comments
Closed
2 tasks

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

enzo-mourany opened this issue May 25, 2022 · 4 comments
Labels
status: needs reproduction this issue needs to provide a repo that reproduces the bug described type: bug code to address defects in shipped code

Comments

@enzo-mourany
Copy link

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

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

No response

Your netlify.toml file

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

Your public/_redirects file

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

Your next.config.js file

`next.config.js`
# 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.
@enzo-mourany enzo-mourany added the type: bug code to address defects in shipped code label May 25, 2022
@ascorbic
Copy link
Contributor

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

@ascorbic ascorbic added the status: needs reproduction this issue needs to provide a repo that reproduces the bug described label May 26, 2022
@enzo-mourany
Copy link
Author

Sure @ascorbic

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

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

module.exports = nextConfig;
`

@ascorbic
Copy link
Contributor

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

@enzo-mourany
Copy link
Author

It's work, thanks @ascorbic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction this issue needs to provide a repo that reproduces the bug described type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants