这是indexloc提供的服务,不要输入任何密码
Skip to content

Static Export Error 500 page #81980

@GabenGar

Description

@GabenGar

Link to the code that reproduces this issue

https://github.com/87906913/408919357/tree/main/nextjs/static-export-500

To Reproduce

Instructions are in the readme.

Current vs. Expected behavior

Expect the project to build but it doesn't build due to cyclic errors.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10
  Available memory (MB): 8 192
  Available CPU cores: 4
Binaries:
  Node: 22.14.0
  npm: 10.8.0
Relevant Packages:
  next: 15.4.3
  eslint-config-next: 15.4.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.8.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Internationalization (i18n), Route Groups

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

I was updating dependencies in my monorepo, in which nextjs with app router was used for building static pages for Github Pages and then got hit with obscure errors.

The pages are structured like this:

  • / - a page with language selector, which doesn't know the language
  • /[lang] - the rest of the pages exist behind the localized path and therefore derive language from it

Since there is a total of 1 (ONE) page which doesn't derive its locale from the pathname, I've opted for grouped layouts ((language-select) and (main) respectively), instead of checking and erroring on unknown locale everywhere.
The first error was from nextjs trying to build /404 page, which was ofc hitting /[lang] but 404 is not a lang tag, not to mention it's not listed in generateStaticParams() for (main) layout. So I've made a separate 404 page and it went through, but errored on building a /500 page. I've repeated the process but then got hit with ENOENT error instead.

Also there should be area for Static Export.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions