Skip to content

Conversation

@icco
Copy link

@icco icco commented Mar 24, 2025

This is an attempt to fix #66. As I mentioned in the issue, I don't really understand how this works. I threw AI at the issue to attempt to fix, but I don't understand the issue enough to properly validate if this is a good fix.

@isaacmattern
Copy link

Hi. I left a like and a comment on the issue you opened, as I'm currently facing the same problem. However, I am weary of "throwing AI" at the problem here, and I don't think this code should be merged if you, as the author, can't validate whether you believe it's a good fix. This seems to be a complex issue related to having the same version/instance of React available to the parent app / child React component within an MDX page.

It seems like the solution you proposed would instantiate a new version of React for every component rendered by MDX, which does not seem like a great idea.

@timlrx
Copy link
Owner

timlrx commented Mar 29, 2025

Thanks @icco for opening the issue. Rather than instantiating a new version of React for every component rendered by MDX as @isaacmattern, let me try modifying getMDXComponent directly. This is the code that builds the component and it seems that in the latest version of mdx-bundler it is not possible to pass in a custom runtime to it.

@icco
Copy link
Author

icco commented Mar 29, 2025

Hi. I left a like and a comment on the issue you opened, as I'm currently facing the same problem. However, I am weary of "throwing AI" at the problem here, and I don't think this code should be merged if you, as the author, can't validate whether you believe it's a good fix. This seems to be a complex issue related to having the same version/instance of React available to the parent app / child React component within an MDX page.

It seems like the solution you proposed would instantiate a new version of React for every component rendered by MDX, which does not seem like a great idea.

Mostly just wanted to kick off discussion and provide a possible solution. Glad we've got folks looking into a better solution.

@icco icco closed this Mar 31, 2025
@icco icco deleted the nextjs branch March 31, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

evaling code breaks if code contains import statements with sources that should be resolved by the bundler

3 participants