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

Safari does not show all stories #12771

Closed
michaelaflores opened this issue Oct 14, 2020 · 7 comments
Closed

Safari does not show all stories #12771

michaelaflores opened this issue Oct 14, 2020 · 7 comments

Comments

@michaelaflores
Copy link

Describe the bug
When viewing our Storybook in Safari, various stories are missing from the sidebar. The missing stories are revealed when viewing our Storybook in Chrome.

To Reproduce
Steps to reproduce the behavior:

  1. Open Storybook on Safari and Chrome

Expected behavior
Stories show up in the sidebar identically across major browsers.

Screenshots
Safari on left, Chrome on right.
Screen Shot 2020-10-14 at 12 04 30 PM

Code snippets
N/A

System
System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Binaries:
Node: 12.16.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Browsers:
Chrome: 86.0.4240.80
Firefox: 76.0.1
Safari: 14.0
npmPackages:
@storybook/addon-a11y: ^6.0.21 => 6.0.21
@storybook/addon-actions: ^6.0.20 => 6.0.20
@storybook/addon-docs: ^6.0.20 => 6.0.20
@storybook/addon-essentials: ^6.0.20 => 6.0.20
@storybook/addon-knobs: ^6.0.21 => 6.0.21
@storybook/addon-links: ^6.0.20 => 6.0.20
@storybook/node-logger: ^6.0.20 => 6.0.20
@storybook/preset-create-react-app: ^3.1.4 => 3.1.4
@storybook/preset-typescript: ^3.0.0 => 3.0.0
@storybook/react: ^6.0.20 => 6.0.20

Additional context
N/A

@michaelaflores
Copy link
Author

In case this is relevant, my main.js contains:

const path = require('path')
const TSDocgenPlugin = require('react-docgen-typescript-webpack-plugin');
module.exports = {
  stories: [
    "../stories/**/*.stories.mdx",
    "../stories/**/*.stories.@(js|jsx|ts|tsx)",
  ],
  addons: [
    "@storybook/addon-knobs",
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/preset-create-react-app",
    {
      name: "@storybook/addon-docs",
      options: {
        configureJSX: true,
      },
    },
  ],
  webpackFinal: async (config, { configType }) => {
    config.module.rules.push({
      test: /\.svg$/,
      loader: "svg-url-loader",
    });
    config.module.rules.push({
      test: /\.(ts|tsx)$/,
      exclude: /node_modules/,
      use: {
        loader: "ts-loader",
        options: {
          compiler: 'ttypescript',
        }
      }
    });
    // config.plugins.push(new TSDocgenPlugin()); // removing, as it adds minutes to build time, perhaps can be added for production builds if needed
    config.resolve.extensions.push('.ts', '.tsx');
    return config
  },
  typescript: {
    check: false,
    checkOptions: {},
    reactDocgen: 'react-docgen-typescript',
    reactDocgenTypescriptOptions: {
      shouldExtractLiteralValuesFromEnum: true,
      propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
    },
  },
};

@shilman
Copy link
Member

shilman commented Oct 14, 2020

Are there any errors in the browser console?

@michaelaflores
Copy link
Author

michaelaflores commented Oct 14, 2020

@shilman there are a few, only these:
image

@shilman
Copy link
Member

shilman commented Oct 15, 2020

@michaelaflores those unexpected errors are why, and have something to do with your components. AFAICT it's unrelated to storybook

@michaelaflores
Copy link
Author

@shilman is my expectation that a Storybook component can throw an error and Storybook will still be able to show unrelated stories incorrect?

@shilman
Copy link
Member

shilman commented Oct 16, 2020

@michaelaflores rendering errors absolutely. loading errors apparently not. we load stories by using webpack require, and apparently that's not resilient to errors.

@stale
Copy link

stale bot commented Dec 25, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants