-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
runtime issue - _convertSourceMap(...).default.removeComments is not a function #536
Comments
Hmmm, yeah looks like babel introduced some runtime breakage. I think we need to stub the We'd happily accept a PR with tests for runtime. Apologies it's been so unstable/flaky! 😬 |
This can be fixed by adding a mock via your webpack config:
Check out https://webpack.js.org/configuration/node/#other-node-core-libraries |
Tried
removes both warnings, and runtime actually starts working. Thought in environments where you can't modify the webpack (e.g. netlify cms), it breaks as described in the issue 😕 |
I've added docs for those that can modify the webpack config to work in the browser. For a full fix we'll need to investigate using Babel standalone. |
I don't like to be an unhelpful +1 person, but I would really love to see this fixed and I think it's beyond me to do it. A stable @mdx-js/runtime could enable a lot of neat tooling around mdx, like dedicated editors, and support prototyping more out-of-the-box ideas (like rendering in Framer X and react native). I took a try at hacking together some kind of dirty fix, shimming fs in the rollup bundling, because I REALLY wanted to try it in Framer X, but I couldn't figure anything out. What would moving to babel standalone involve? Or do you have any pointers for a hacky fix? |
I've opened up a new issue which can be centered around figuring out how to best get a more runtime-friendly implementation. It's something that it's definitely worth doing, though I'm not sure if that means moving to Maybe we could figure out a solution in the near future! |
Subject of the issue
I'm trying to use latest version of runtime using example code and the runtime seems completely broken in V1 (
1.0.0-rc.0
seemed to work with warnings but still).Uncaught TypeError: _convertSourceMap(...).default.removeComments is not a function
error get's thrown.Your environment
"@mdx-js/runtime": "^1.0.9",
,"@mdx-js/mdx": "^1.0.9",
Steps to reproduce
Just try to use the runtime (repo)
Also v1 seemed to introduce an error warning:
(repo)
this prevents runtime from being used in gatsby-netlify-cms - gatsbyjs/gatsby#10326
P.S. would you accept a MR with tests for runtime? As I'm developing a netlify-cms-widget-mdx, I very much depend on the stability and consistency of the runtime, so I would gladly chip in.
The text was updated successfully, but these errors were encountered: