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

TypeError: Cannot read property '18' of undefined #24

Closed
4 tasks done
chenxsan opened this issue Sep 2, 2021 · 7 comments
Closed
4 tasks done

TypeError: Cannot read property '18' of undefined #24

chenxsan opened this issue Sep 2, 2021 · 7 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@chenxsan
Copy link

chenxsan commented Sep 2, 2021

Initial checklist

Affected packages and versions

remark-gfm 2.0.0

Link to runnable example

No response

Steps to reproduce

  1. clone code from Use ESM webpack/webpack.js.org#5396
  2. run yarn
  3. run yarn start

Expected behavior

No error.

Actual behavior

Errors like Cannot read property '29' of undefined show up many times. For example, https://github.com/webpack/webpack.js.org/pull/5396/checks?check_run_id=3495415399#step:5:3025.

FYI we don't use react-markdown, so it might not be related to #22. And the error is not helpful at all, so I don't know how to track it down the problem.

Runtime

Node v12

Package manager

yarn v1

OS

Linux

Build and bundle tools

Webpack

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Sep 2, 2021
@ChristianMurphy
Copy link
Member

Cannot read property '18' of undefined

the error is not helpful at all, so I don't know how to track it down the problem.

It sounds like an error coming from micromark.
Micromark has a production build and a debug build (which produces nicer errors) https://github.com/micromark/micromark#api
You can access the debug build by adding --conditions development to the node call which runs remark/micromark.

@wooorm
Copy link
Member

wooorm commented Sep 2, 2021

Probably a mismatch between versions: either upgrade the other tools, or downgrade remark-gfm!

@chenxsan
Copy link
Author

chenxsan commented Sep 2, 2021

There's no error with the lower version remark-gfm. My plan in that pull request is to migrate all remark plugins to the ESM versions, so downgrading would be my last resort.

Anyway I've tried replacing @mdx-js/loader@2.0.0-next.9 with xdm, that errors were gone. So it might be the cause.

@wooorm
Copy link
Member

wooorm commented Oct 3, 2021

Closing this as it’s more of an external issue. mdx-js should soon be up to do btw!

@wooorm wooorm closed this as completed Oct 3, 2021
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label Oct 3, 2021
@github-actions

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Oct 3, 2021
@RomanHotsiy
Copy link

I'm using the latest next.9 version of mdx-js with remark-gfm@3.0.0 and still getting this error.

@wooorm is it expected?

Maybe it's worth to keep either this issue open or open an issue in mdx-js repo so this won't get missed for the 2.0 release of mdx-js?

Also, do you know the root cause of the issue or do you need help to find it out? I'd be happy to help 🙌

@wooorm
Copy link
Member

wooorm commented Oct 16, 2021

Hey! It's expected. You can use v1 with the latest mdx I believe.
It is already solved on main in mdx-js, and a new RC is likely to go out on Tuesday or so.

If you want to help, you can do so by proofreading the site for the much improved RC and V2: v2.mdxjs.com. Note though that the corresponding RC has not yet been released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

4 participants