Skip to content

Having "next export" in npm script fails build, even if unused.  #67

Closed
@racedale

Description

@racedale

Error message ** Static HTML export next.js projects do not require this plugin ** was caused by "export": "next export" existing in my package.json file. I removed "npm run export" from my netlify.toml file when converting my site from SSG to adding some SSR pages, but had left that command in package.json (not documented in any posts that I would need to make sure to remove it).

Was very very confusing to figure out. I think the easiest fix is updating the error message to be more specific to what is detected. But maybe there is another thing to detect off of? I'm new to Next so not sure.

File with detection logic

Also off topic, but for a new NextJS dev the docs around next-on-netlify vs this plugin were confusing. Is next-on-netlify legacy? Is this one the only way to also have custom functions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions