syntax-tree / mdast-util-from-markdown

mdast utility to parse markdown
MIT License
212 stars 20 forks source link

`Cannot read property 'write' of undefined` when parsing some lists #27

Closed mathieudutour closed 3 years ago

mathieudutour commented 3 years ago

Initial checklist

Affected packages and versions

1.0.4

Link to runnable example

https://codesandbox.io/s/remark-debug-forked-38j17

Steps to reproduce

Try to parse

* a
  * * b
  * * c

Expected behavior

Does not throw an error

Actual behavior

Throws Cannot read property 'write' of undefined

Runtime

Node v16

Package manager

npm v7

OS

macOS

Build and bundle tools

Webpack

wooorm commented 3 years ago

Can you throw your node_modules away and reinstall?

I added import { micromark } from "micromark"; and console.log(micromark(sourceMarkdown)); to your codesandbox and it failed, when I added micromark as a dependency and updated it, it worked. Throwing those changes away, keeping your original remark code, worked.

wooorm commented 3 years ago

I think it was solved in https://github.com/micromark/micromark/releases/tag/3.0.4

mathieudutour commented 3 years ago

It is indeed solved, sorry about the noise

github-actions[bot] commented 3 years ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

wooorm commented 3 years ago

no problem, instead rather annoying that codesandbox has such a strong cache and no control over re-installing!