Skip to content

Build error when opt-out static optimatization and providing custom Error page #22907

@piotrrussw

Description

@piotrrussw

What version of Next.js are you using?

10.0.8

What version of Node.js are you using?

14.x.x

What browser are you using?

What operating system are you using?

linux

How are you deploying your application?

other

Describe the Bug

After upgrading to next.js 10.0.8 I can't build my application. I get the following error:

Error occurred prerendering page "/404". Read more: https://err.sh/next.js/prerender-error
TypeError: res.writeHead is not a function

I have opt-out static optimatization in _app.js and provide custom _error.js page.
The following error throws during build process and affects pages: /404, /404.html, /500
I think it might be connected with #22139

Expected Behavior

To be able to build page

To Reproduce

You can try same configuration as in sandbox

Not sure if it is a bug or it requires docs update.

Best,
Piotr

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions