-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Parser broken #9
Comments
hey thanks! Your steps to reproduce are too short. we have a lot of tests. It all works. I’m thinking it has to do with webpack or some other tooling you have set up |
webpack 4 is widely used (CRA, next) and does not like actual ESM + CJS projects if default exports are used. This removes ESM from `dist/` and tests on `lib/` (dev build) instead. Related to remarkjs/react-markdown#518. Related to syntax-tree/mdast-util-from-markdown#9.
Solved |
Hey! Sorry for the brevity in reproduction steps; took a while to hunt down the source of this bug and didn’t have the energy to clone locally and run the test suite :) I had thought it could’ve been my local environment, but after spinning up a totally fresh directory and installing just the necessary dependencies ( Have you tried to reproduce outside of the testing? Possible test coverage doesn't catch this one. |
Heya! A couple hours before you (while I was sleeping) this issue also arose: remarkjs/react-markdown#518. Sorry I didn’t link that before, but that should have the info you’re looking for. Or does it seem your issue is completely unrelated? |
Coverage does not catch this. The issue determined based off the reports in remarkjs/react-markdown#518 was improper handling of ESM/MJS by WebPack 4 with specific configs. |
@wooorm That resolved it! Huge thanks; this was a strange one. @ChristianMurphy Totally. Not worth the trouble of expanding testing around this sort of issue since it was isolated to WebPack, and like you said, “when to say when” is a question with this type of thing. Glad to know I wasn’t going crazy with this one! I encountered the problem after a decently sized refactor of my codebase, and was positive it was related to my own sloppiness for a couple hours 😂 |
Subject of the issue
Running into an issue with
parser
being undefined when usingremark-parse
. Traced the issue down to this dependency. Looks to have been introduced with the latest version of Micromark. After installingremark-parse@8.0.3
which limitsmdast-util-from-markdown
to semver^0.7.0
it resolved my issue, so stopped pursuing. Leaving this here for triage, hopefully its useful!24ec72a
Your environment
11.0.1
unified
remark-parse
node v15.2.1
Steps to reproduce
Install any
unified
plugin which depends uponmdast-util-from-markdown
0.8.4
and the latest version ofmicromark
.Expected behavior
Should parse the source successfully.
Actual behavior
Instead there is an error saying
parse is not a function
.The text was updated successfully, but these errors were encountered: