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

Errors in IE11 Storybook 6.4.9 #17057

Closed
anton-prok opened this issue Dec 22, 2021 · 6 comments
Closed

Errors in IE11 Storybook 6.4.9 #17057

anton-prok opened this issue Dec 22, 2021 · 6 comments
Assignees

Comments

@anton-prok
Copy link

anton-prok commented Dec 22, 2021

After updating Storybook to the last version (6.4.9), I become get an error in IE11 (in other browsers it works fine):
image
If i open it, I can see, that issue comes from unabling to destructuring object with variable initialization (my guess):
image

But as I can see from these dependencies, Storybook already use appropriate plugin to support this feature (line 69):
https://github.com/storybookjs/storybook/blob/next/lib/core-common/src/utils/babel.ts

I also have disabled Docs from Essentials addon:
image

Here's my main.js:

const path = require('path');

module.exports = {
    stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
    addons: [
        '@storybook/addon-links',
        {
            name: '@storybook/addon-essentials',
            options: {
                docs: false,
            },
        },
        '@storybook/addon-ie11',
    ],
    framework: '@storybook/react',
    webpackFinal: async (config, { configType }) => {
        config.module.rules.push({
            test: /\.scss$/,
            use: ['style-loader', 'css-loader', 'sass-loader'],
            include: path.resolve(__dirname, '../'),
        });

        config.resolve = Object.assign(config.resolve, {
            alias: {
                '~api': path.resolve(__dirname, '../src/api/'),
                '~components': path.resolve(__dirname, '../src/components/'),
                '~containers': path.resolve(__dirname, '../src/containers/'),
                '~img': path.resolve(__dirname, '../src/img/'),
                '~redux_related': path.resolve(__dirname, '../src/redux_related/'),
                '~routes': path.resolve(__dirname, '../src/routes/'),
                '~utils': path.resolve(__dirname, '../src/utils/'),
                '~styles': path.resolve(__dirname, '../src/styles/'),
                '~fonts': path.resolve(__dirname, '../src/fonts/'),
                '~ui': path.resolve(__dirname, '../src/ui/'),
            },
        });

        return config;
    },
};

Any advice?

@shilman
Copy link
Member

shilman commented Dec 23, 2021

As far as I know, Storybook 6.4 itself is compatible with IE11. We have a CI step that verifies that: https://www.chromatic.com/builds?appId=5def629a9aec2800201cd626

Are you using MemoryRouter in your project configuration, perhaps a decorator in .storybook/preview.js? It looks like that's not getting properly transpiled to IE11-compatible JS.

@inthegreenwild
Copy link

I have the same exact issue with 6.4.8 and 6.4.9
I am not using any decorators and the only addon I have is essentials with docs disabled.

@inthegreenwild
Copy link

inthegreenwild commented Jan 4, 2022

@shilman shilman

The error is coming from react router which was introduced into the storybook router in 6.4. I think this is the culprit for breaking IE 11 support. I downgraded to 6.3.12 and storybook will start up again. However, the stories never finish loading due to a new error:

Unable to get property "call" of undefined or null reference
vendor-main.manager.bundle.js

For reference I'm using storybook/html

@shilman
Copy link
Member

shilman commented Jan 5, 2022

Thanks @inthegreenwild. I can confirm the problem. Storybook is built in two parts: the outer UI called the manager, and an inner iframe called the preview which is where your stories are rendered. Our CI tests that we didn't break the preview, but it does not test the manager. The react-router upgrade broke the manager UI, but we should be able to fix it.

@shilman
Copy link
Member

shilman commented Jan 6, 2022

Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.10 containing PR #17141 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jan 6, 2022
@inthegreenwild
Copy link

Tested in IE 11 and it's working, thanks!

coldlink added a commit to guardian/gateway that referenced this issue Feb 4, 2022
Fixes IE11 issues using storybookjs/storybook#17057

Uses webpack5 loader for storybook https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack-5

Updates dev deps

Uses polyfill.io for storybook too

Co-authored-by: Oliver Barnwell <ob6160@users.noreply.github.com>
coldlink added a commit to guardian/gateway that referenced this issue Feb 4, 2022
Fixes IE11 issues using storybookjs/storybook#17057

Uses webpack5 loader for storybook https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack-5

Updates dev deps

Uses polyfill.io for storybook too

Co-authored-by: Oliver Barnwell <ob6160@users.noreply.github.com>

feat: remove corejs
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

4 participants