storybook icon indicating copy to clipboard operation
storybook copied to clipboard

Console error about server-side rendering on a Docs page

Open hudochenkov opened this issue 3 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

When opening any Docs page in Storybook following console warning appear in a browser console:

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".

Similar bug was fixed in #18103 but the fix didn't fix this bug.

To Reproduce To reproduce run locally (production build is not affected):

npx sb repro --template react_typescript
cd react_typescript
yarn storybook

Open “Button” component and then “Docs” tab:

Screen Shot 2022-06-23 at 15 17 32

Alternatively clone this repository https://github.com/hudochenkov/storybook-console-error-18103 (difference from steps above: I used React 17 and npm). But error is the same in both cases.

System

Environment Info:

  System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.13.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 102.0.5005.61
    Firefox: 102.0
    Safari: 15.5
  npmPackages:
    @storybook/addon-actions: ^6.5.9 => 6.5.9
    @storybook/addon-docs: ^6.5.9 => 6.5.9
    @storybook/addon-essentials: ^6.5.9 => 6.5.9
    @storybook/addon-interactions: ^6.5.9 => 6.5.9
    @storybook/addon-links: ^6.5.9 => 6.5.9
    @storybook/builder-webpack4: ^6.5.9 => 6.5.9
    @storybook/manager-webpack4: ^6.5.9 => 6.5.9
    @storybook/react: ^6.5.9 => 6.5.9
    @storybook/testing-library: ^0.0.13 => 0.0.13

Additional context Console.error was introduced in 6.5, and doesn't exist in 6.4.22.

hudochenkov avatar Jul 07 '22 08:07 hudochenkov

I've finally fixed the underlaying issue in Emotion and thus this issue here should get fixed by this PR: https://github.com/storybookjs/storybook/pull/18992

Andarist avatar Aug 22 '22 15:08 Andarist

@Andarist do you know if your fix has ever been released or is it gonna be part of Storybook 7?

alopix avatar Oct 19 '22 13:10 alopix

This is going to be fixed in 7.0 @alopix

ndelangen avatar Oct 20 '22 07:10 ndelangen

i installed v6.5.15 but i got the same error

motionrus avatar Jan 16 '23 17:01 motionrus

I'm on version v7.0.0-beta.31 and I still get that error, what is it due to? It's too annoying

Tech-Code1 avatar Jan 21 '23 05:01 Tech-Code1

@Tech-Code1 could u prepare a runnable repro code?

Andarist avatar Jan 21 '23 06:01 Andarist

v7.0.0-beta.50 still have same error

zigang93 avatar Feb 20 '23 02:02 zigang93

@zigang93 could you supply a reproduction repo?

ndelangen avatar Feb 20 '23 15:02 ndelangen

Just adding that "storybook": "7.1.1" has the console error.

SaurabhBose avatar Apr 02 '24 22:04 SaurabhBose