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

with-rebass example's _document.js does nothing #40366

Closed
1 task done
yume-chan opened this issue Sep 8, 2022 · 1 comment · Fixed by #40395
Closed
1 task done

with-rebass example's _document.js does nothing #40366

yume-chan opened this issue Sep 8, 2022 · 1 comment · Fixed by #40395
Labels
examples Issue/PR related to examples

Comments

@yume-chan
Copy link

yume-chan commented Sep 8, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 16.15.1
  npm: 8.11.0
  Yarn: 1.22.18
  pnpm: 7.5.2
Relevant packages:
  next: 12.3.0
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0

Which example does this report relate to?

with-rebass

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

I'm checking #39871 to learn how to write a functional style Document component.

The _docuemnt.js in this example does nothing: It only renders an empty <style> tag and an extra <div class="root"> tag.

In both next dev and next build, all styles are collected and rendered into <body> at server side.

Expected Behavior

I don't know. Maybe it should collect all styles into the <style> tag in <head>, like the with-styled-components example does.

To Reproduce

  1. npx create-next-app --example with-rebass with-rebass-app
  2. npm run build, back up .next/server/pages/index.html somewhere
  3. Delete pages/_document.js
  4. npm run build again
  5. Compare two index.html files
@yume-chan yume-chan added the bug Issue was opened via the bug report template. label Sep 8, 2022
@balazsorban44 balazsorban44 added the examples Issue/PR related to examples label Sep 9, 2022
@balazsorban44 balazsorban44 mentioned this issue Sep 9, 2022
11 tasks
@balazsorban44 balazsorban44 removed the bug Issue was opened via the bug report template. label Sep 9, 2022
balazsorban44 added a commit that referenced this issue Sep 9, 2022
Closes #40366

Rebass is not dependent on `styled-components` anymore. See:
https://rebassjs.org/migrating/#v4-breaking-changes

Closes #40367

Document has been converted (#39871) from class, so `this.props` threw
an error.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants