Skip to content
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

import mdx from parent directory cause Hydration fail #1424

Closed
Chastrlove opened this issue Jan 29, 2023 · 5 comments
Closed

import mdx from parent directory cause Hydration fail #1424

Chastrlove opened this issue Jan 29, 2023 · 5 comments
Labels
wontfix This will not be worked on
Milestone

Comments

@Chastrlove
Copy link

Here is my repo. The nextra site is located in /doc while I want to include the README.md file.

image

@dimaMachina dimaMachina added the bug Something isn't working label Jan 29, 2023
@dimaMachina
Copy link
Collaborator

dimaMachina commented Jan 30, 2023

Unfortunately, I didn't find a way to fix it, also mdx-js suggest not importing MDX outside of CWD mdx-js/mdx#1944 (comment)

Because components for imported MDX outside of CWD on the server is {}

image

image

Also, in Nextra v3 I will remove the current workaround to make it works as it is antipattern and will produce unexpected behaviour. cc @shuding

@dimaMachina dimaMachina added wontfix This will not be worked on and removed bug Something isn't working labels Jan 30, 2023
@dimaMachina dimaMachina mentioned this issue Jan 30, 2023
20 tasks
@Chastrlove
Copy link
Author

Unfortunately, I didn't find a way to fix it, also mdx-js suggest not importing MDX outside of CWD mdx-js/mdx#1944 (comment)

Because components for imported MDX outside of CWD on the server is {}

image image

Also, in Nextra v3 I will remove the current workaround to make it works as it is antipattern and will produce unexpected behaviour. cc @shuding

Why the components for imported MDX outside of CWD on the server is "{}" , is that the react context or webpack problem?

@dimaMachina
Copy link
Collaborator

Idk 🤷🏻‍♂️

@Chastrlove
Copy link
Author

@shuding can you for help?

@dimaMachina
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants