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

[Bug]: Internal server error: Cannot read properties of undefined (reading 'inTable') #24743

Closed
BrotaOne opened this issue Nov 7, 2023 · 7 comments

Comments

@BrotaOne
Copy link

BrotaOne commented Nov 7, 2023

Describe the bug

I want to use GFM in mdx2, but get a error when following the instruction in website.

using "storybook": "^7.5.2", and initialize the project by vite and storybook

even when opening Configure.mdx created by storybook, it would report a error

the error is

[vite] Internal server error: Cannot read properties of undefined (reading 'inTable')
  Plugin: storybook:mdx-plugin

here is my config

import type { StorybookConfig } from "@storybook/react-vite";
import remarkGfm from 'remark-gfm';

const config: StorybookConfig = {
  stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
  addons: [
    {
      name: '@storybook/addon-docs',
      options: {
        mdxPluginOptions: {
          mdxCompileOptions: {
            remarkPlugins: [remarkGfm],
          },
        },
      },
    },
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-onboarding",
    "@storybook/addon-interactions",
  ],
  framework: {
    name: "@storybook/react-vite",
    options: {},
  },
  docs: {
    autodocs: "tag",
  },
};
export default config;

To Reproduce

No response

System

System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.17.3 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
    pnpm: 7.14.2 - ~/.nvm/versions/node/v16.14.2/bin/pnpm <----- active
  Browsers:
    Chrome: 119.0.6045.105
    Safari: 16.5.2
  npmPackages:
    @storybook/addon-docs: ^7.5.2 => 7.5.2 
    @storybook/addon-essentials: ^7.5.2 => 7.5.2 
    @storybook/addon-interactions: ^7.5.2 => 7.5.2 
    @storybook/addon-links: ^7.5.2 => 7.5.2 
    @storybook/addon-onboarding: ^1.0.8 => 1.0.8 
    @storybook/blocks: ^7.5.2 => 7.5.2 
    @storybook/react: ^7.5.2 => 7.5.2 
    @storybook/react-vite: ^7.5.2 => 7.5.2 
    @storybook/testing-library: ^0.2.2 => 0.2.2 
    eslint-plugin-storybook: ^0.6.15 => 0.6.15 
    storybook: ^7.5.2 => 7.5.2

Additional context

No response

@Ademsk1
Copy link

Ademsk1 commented Nov 7, 2023

Getting something similar : Cannot read properties of undefined (reading 'content'), this is after the new update. Using storybook 7.5.2 for everything (and plugins) fixed it.

@morinted
Copy link

morinted commented Nov 7, 2023

I was able to workaround by downgrading to remark-gfm@^3.0.0 instead of ^4.0.0

@BrotaOne
Copy link
Author

BrotaOne commented Nov 8, 2023

I was able to workaround by downgrading to remark-gfm@^3.0.0 instead of ^4.0.0

thanks, it works for me

@embostan
Copy link

I was able to workaround by downgrading to remark-gfm@^3.0.0 instead of ^4.0.0

Thanks

@vanessayuenn
Copy link
Contributor

@yannbf @shilman do we get the fix to this for free by upgrading to mdx3 somehow?

rajsite added a commit to ni/nimble that referenced this issue Mar 6, 2024
# Pull Request

## 🤨 Rationale

Gets all dependencies up-to-date (as reported by `npm outdated`) except
the following:
- `@angular/*`, `zone.js`, `ng-packagr`, `typescript`: Coupled to
current Angular version
- `@microsoft/fast-foundation` and `@microsoft/fast-react-wrapper`:
Pinned due to microsoft/fast#6906
- `playwright`: Latest version on nuget 1.41.2 not aligned with npm
1.42.1. There are some 1.42 beta releases on nuget so guess something is
going on there. Didn't look into it more.
- `remark-gfm`: Updating it to latest caused storybook build errors and
only recommendation seems to be [avoid upgrading `remark-gfm` to
v4](storybookjs/storybook#24743 (comment)).

## 👩‍💻 Implementation

Updated and fixed build & lint.

## 🧪 Testing

Relying on CI.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
rajsite added a commit to ni/nimble that referenced this issue Mar 6, 2024
# Pull Request

## 🤨 Rationale

- Updated `fetch-depth: 0` comment from being [needed by
beachball](microsoft/beachball#780) to being
[needed by
chromatic](https://github.com/ni/nimble/actions/runs/8164295790/job/22319288123#step:14:50).
- Updated renovate to make a single PR for npm updates that we can let
update to latest.
  - Angular and it's related packages are ignored
    - `^@angular`, `ng-packagr`, `zone.js`, `typescript`
  - Pinned packages are ignored
- `@microsoft/fast-foundation` and `@microsoft/fast-react-wrapper` due
to [fast issue](microsoft/fast#6906)
- `comlink` as it is partially vendored into workers and needs a
controlled and pinned update
- `remark-gfm` as [updating breaks
mdx](storybookjs/storybook#24743 (comment))
- Removed npm version specific install that was now downgrading the npm
version accidentally.
- Removed file permission workaround [no longer needed to prevent
warnings](actions/upload-pages-artifact#45).
- Updated the beachball patch-package

## 👩‍💻 Implementation

See above.

## 🧪 Testing

Relying on CI.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@gethari
Copy link

gethari commented Mar 20, 2024

I was able to workaround by downgrading to remark-gfm@^3.0.0 instead of ^4.0.0

Excellent, worked for me too

@Lukas742
Copy link

The update to Storybook v8, which also includes MDX v3, resolved the issue for us. Specifically, we found that we could only successfully build Storybook version 8 when using remark-gfm@^4.0.0, as versions lower than v4 caused errors.

1emu added a commit to decentraland/governance-ui that referenced this issue Apr 22, 2024
andyesp pushed a commit to decentraland/governance-ui that referenced this issue Apr 22, 2024
* chore: scroll to hash when location changes

* fix: downgrade remark-gfm storybookjs/storybook#24743

* fix: removed ordered prop to avoid warnings for "received `false` for a non-boolean attribute `ordered`"

* fix: sign reported erros only if signed in

* fix: sign get user bids only if signed in

* fix: listitem warning, address pr comment

* fix: make scroll to hash a hook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants