modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.21k stars 281 forks source link

Accessibility Tab in Storybook builder is not working #2683

Closed Rajdeepc closed 6 months ago

Rajdeepc commented 6 months ago

I am running my web component library with the below diagnostics.


"dependencies": {
      "@storybook/addon-a11y": "^7.5.0",
      "@storybook/addon-essentials": "^7.5.0",
      "@storybook/addon-links": "^7.5.0",
      "@storybook/web-components": "^7.5.0",
      "@web/storybook-builder": "^0.1.7",
      "@web/storybook-framework-web-components": "^0.1.1",
      "storybook": "^7.5.0",
}

Whenever I go to my Accessibility Tab in my storybook I am getting the below error. Need some help here!!

Screenshot 2024-03-27 at 10 53 24 PM

This is my main.js

const config = {
    stories: [
        '../packages/*/stories/*.stories.js',
        '../tools/*/stories/*.stories.js',
    ],
    addons: [
        '@storybook/addon-links',
        '@storybook/addon-essentials',
        '@storybook/addon-a11y',
    ],
    framework: {
        name: '@web/storybook-framework-web-components',
    },
    wdsFinal(config) {
        const json = fromRollup(rollupJson);
        return mergeConfigs(config, {
            nodeResolve: {
                exportConditions: ['browser', 'development'],
                moduleDirectories: [
                    'node_modules',
                    'packages',
                    'projects',
                    'tools',
                ],
            },
            clearTerminalOnReload: false,
            mimeTypes: {
                '**/*.json': 'js',
            },
            plugins: [json(), watchSWC()],
            http2: true,
            watch: true,
        });
    },
bashmish commented 6 months ago

@Rajdeepc I published a PR with what I had so far, but I'm running into a weird issue RollupError: Identifier "_typeof" has already been declared in the storybook static build generator, which I couldn't solve yet. Feel free to look into this if you want to help.

bashmish commented 6 months ago

Apparently rollup 4.4.0 had a bug. And 4.4.0 was coincidentally the min version we required.

It was fixed in 4.4.1: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#441

## 4.4.1

_2023-11-14_

### Bug Fixes

- Do not flag duplicate function declarations in function scopes as syntax errors (#5248)

### Pull Requests

- [#5248](https://github.com/rollup/rollup/pull/5248): Allow functions to redeclare vars and functions in function scopes (@lukastaegert)

I bumped the minimum rollup version to 4.4.1 and test succeded now. Gonna merge and release soon.

bashmish commented 6 months ago

Released in @web/storybook-builder@0.1.10 https://github.com/modernweb-dev/web/pull/2686