-
-
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
mdx v2: import URL causes fail to compile error #1802
Comments
TypeScript can’t deal with it properly.
Where? Several people are using xdm and mdxjs/mdx@next without errors. And |
I'm using webpack 5 for production bundling.
https://github.com/mdx-js/mdx/blob/079c8c7bb953dda5e59cf4c93fb924ad07b15ad1/packages/mdx/lib/plugin/recma-document.js |
And how do you configure webpack? For example, I'm currently using all of this swimingly with webpack through next |
I worked on the problem a bit more overnight and figured out the problem was caused by the version of nextjs I was using. The compile error clears when I changed the next package from |
Subject of the issue
The
import {URL} from 'url'
line in recma-document plugin creates a compile error.I don't think it's necessary to import the URL class since it's a global object?
Your environment
Steps to reproduce
yarn build
a nextjs project.Expected behaviour
Project compiles.
Actual behaviour
Failed to compile due to error.
The text was updated successfully, but these errors were encountered: