Skip to content
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

"Component definition is missing display name" Next.js build fail using code from docs #29204

Closed
tr1s opened this issue Sep 19, 2021 · 4 comments
Labels
bug Issue was opened via the bug report template.

Comments

@tr1s
Copy link

tr1s commented Sep 19, 2021

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

15.5.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

A recent update in my npm packages (probably from Next.js) has caused build failures.

The code styled-components provides in the docs that you add to _document.js in order for styled-components to work in a Next.js project is no longer working.

I can't figure out how to fix this code even when looking at the react/display-name rules. Any help would be appreciated, thank you!

The error I get in vercel:

CleanShot 2021-09-18 at 21 13 24@2x

What the error looks like in my code:

CleanShot 2021-09-18 at 21 01 36@2x

These are the package updates I made that caused the sudden build failure:

CleanShot 2021-09-18 at 21 24 54@2x

Expected Behavior

No build errors.

To Reproduce

Add the code from styled-components docs to _document.js in order for styled-components to work in a Next.js project.

@tr1s tr1s added the bug Issue was opened via the bug report template. label Sep 19, 2021
@stefanprobst
Copy link
Contributor

see #28786 (comment)

@ijjk
Copy link
Member

ijjk commented Sep 19, 2021

Closing as a duplicate of #28786 (comment) per above comment

@ijjk ijjk closed this as completed Sep 19, 2021
@tr1s
Copy link
Author

tr1s commented Sep 19, 2021

For whoever stumbles across this:

Naming the function doesn't fix this issue, but downgrading eslint-config-next does fix the build error.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants