opennextjs-netlify: [Bug]: 4.0.0-rc.1 builds empty pages—assets are empty/served as documents

Steps to reproduce

So far, I’ve been unable to create a minimal test reproduction, but the issue is affecting a site I currently use with netlify. I would have reported in the discussion but the conversation has been locked.

The issue is essentially that every page renders without almost any markup, and no styles or js. The pages exist, but they are empty.

I believe this is because all of the generated assets are empty. When I inspect the document <head> I can see that all of the included js assets are served as empty document files. (I would expect them to be served as script files, and to not be empty).

I’ve inspected the function logs but these are entirely empty as well.

For now I’m continuing to use 4.0.0-beta.4, which was the last working v4 for me.

Thanks!

A link to a reproduction repository

No response

Plugin version

4.0.0-rc.1

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?

Mac OS

Your netlify.toml file

`netlify.toml`
[build]
publish = ".next"

[[plugins]]
package = "@netlify/plugin-nextjs"

Relevant log output (or link to your logs)

Build logs
# Paste logs here

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Great! I think we should say that asset optimization shouldn’t be used with Next.js, as it already compresses its assets. In beta 4 it probably didn;t actually optimise them, because they were served via the function. In later versions we’ve become more efficient at offloading static files to the CDN to improve performance.

I’m going to close this, as it seems the original problem is fixed. I’ll look into how we should best handle conflicts like this.

Thanks for the details. I need to talk to some of my colleagues about this. It’s not somethign I’ve seen before, so I don’t know what coudl be causing it. I’ll get back to you when I have more info.